CounterexampleIntegral.lean
1module23public import D5.S3.Quantum.Subentropy.UniformIntegrals45/-! Exact rational and logarithmic calculations for the three-qubit witness.6The determinant variable is t; the library integrates in s = 1/t. -/7@[expose] public section8noncomputable section9set_option autoImplicit false10set_option maxHeartbeats 180000011open MeasureTheory Set12namespace SubentropyCertificates.QuantumCounterexample13open D5.S3.Quantum.Subentropy.UniformIntegrals1415def d0 (t : ℝ) := (1+t/2)^216def d1 (t : ℝ) := (1+2*t/5)^2 * (1+t/10)^217def d2 (t : ℝ) := (1+9*t/10)*(1+t/10)18def gap (t : ℝ) := 2/d0 t - 1/d1 t - 1/d2 t19def exactDeficit : ℝ := 2*Real.log 5 - 256/135*Real.log 2 - 81/40*Real.log 3 + 5/182021theorem gap_formula {t : ℝ} (ht : 0 < t) :22 gap t = -(t^2*(5000+2500*t+250*t^2+75*t^3+7*t^4)) /23 (62500*d0 t*d1 t*d2 t) ∧ gap t < 0 := by24 have he : gap t = -(t^2*(5000+2500*t+250*t^2+75*t^3+7*t^4)) /25 (62500*d0 t*d1 t*d2 t) := by26 unfold gap27 have h0 : 0 < d0 t := by unfold d0; positivity28 have h1 : 0 < d1 t := by unfold d1; positivity29 have h2 : 0 < d2 t := by unfold d2; positivity30 field_simp [h0.ne', h1.ne', h2.ne']31 unfold d0 d1 d232 ring33 refine ⟨he, ?_⟩34 rw [he]35 unfold d0 d1 d236 apply div_neg_of_neg_of_pos <;> first | positivity | exact neg_lt_zero.mpr (by positivity)3738private def diff (a b s : ℝ) := 1/(s+a) - 1/(s+b)39private def sqInv (a s : ℝ) := 1/(s+a)^24041private def Evaluates (f : ℝ → ℝ) (v : ℝ) :=42 IntegrableOn f (Ioi 0) ∧ (∫ s in Ioi (0 : ℝ), f s) = v4344private theorem eval_add {f g : ℝ → ℝ} {a b : ℝ} (hf : Evaluates f a) (hg : Evaluates g b) :45 Evaluates (fun s => f s + g s) (a+b) :=46 ⟨hf.1.add hg.1, (integral_add hf.1 hg.1).trans (congrArg₂ (· + ·) hf.2 hg.2)⟩4748private theorem eval_scale {f : ℝ → ℝ} {a : ℝ} (c : ℝ) (hf : Evaluates f a) :49 Evaluates (fun s => c*f s) (c*a) :=50 ⟨hf.1.const_mul c, (integral_const_mul c f).trans (congrArg (c * ·) hf.2)⟩5152private theorem eval_diff (a b : ℝ) (ha : 0 < a) (hab : a ≤ b) :53 Evaluates (diff a b) (Real.log b - Real.log a) := reciprocal_difference a b ha hab5455private theorem eval_sq (a : ℝ) (ha : 0 < a) : Evaluates (sqInv a) (1/a) := by56 change IntegrableOn (fun s : ℝ => 1/(s+a)^2) (Ioi 0) ∧57 (∫ s in Ioi (0 : ℝ), 1/(s+a)^2) = 1/a58 simpa using inverse_power a ha 05960private def expansion (s : ℝ) :=61 17/432*diff (1/10) (1/2) s + 128/135*diff (2/5) (1/2) s +62 (-81/80)*diff (1/2) (9/10) s + (-1/900)*sqInv (1/10) s +63 (-64/225)*sqInv (2/5) s + 1/2*sqInv (1/2) s6465private theorem partial_fractions {s : ℝ} (hs : 0 < s) : gap s⁻¹ = expansion s := by66 have shift (a : ℝ) : 1 + a*s⁻¹ = (s+a)/s := by field_simp67 have repl (a b : ℝ) : a*s⁻¹/b = (a/b)*s⁻¹ := by ring68 unfold gap d0 d1 d2 expansion diff sqInv69 rw [show s⁻¹/2 = (1/2)*s⁻¹ by ring, show s⁻¹/10 = (1/10)*s⁻¹ by ring,70 repl 2 5, repl 9 10]71 simp only [shift, div_pow, div_div_eq_mul_div, mul_div_assoc']72 have h1 : 0 < s+1/10 := by linarith73 have h2 : 0 < s+2/5 := by linarith74 have h5 : 0 < s+1/2 := by linarith75 have h9 : 0 < s+9/10 := by linarith76 field_simp [hs.ne',h1.ne',h2.ne',h5.ne',h9.ne']77 ring7879/-- Improper integral of the signed reciprocal determinant combination at 1/s. -/80theorem gap_integral :81 IntegrableOn (fun s : ℝ => gap s⁻¹) (Ioi 0) ∧82 (∫ s in Ioi (0 : ℝ), gap s⁻¹) = exactDeficit := by83 have he := eval_add (eval_add (eval_add (eval_add84 (eval_add (eval_scale (17/432) (eval_diff (1/10) (1/2) (by norm_num) (by norm_num)))85 (eval_scale (128/135) (eval_diff (2/5) (1/2) (by norm_num) (by norm_num))))86 (eval_scale (-81/80) (eval_diff (1/2) (9/10) (by norm_num) (by norm_num))))87 (eval_scale (-1/900) (eval_sq (1/10) (by norm_num))))88 (eval_scale (-64/225) (eval_sq (2/5) (by norm_num))))89 (eval_scale (1/2) (eval_sq (1/2) (by norm_num)))90 have hid (s : ℝ) (hs : s ∈ Ioi (0 : ℝ)) : gap s⁻¹ = expansion s := partial_fractions hs91 refine ⟨he.1.congr_fun (fun s hs => (hid s hs).symm) measurableSet_Ioi, ?_⟩92 rw [setIntegral_congr_fun measurableSet_Ioi hid]93 change (∫ s in Ioi (0 : ℝ), expansion s) = _94 rw [show (∫ s in Ioi (0 : ℝ), expansion s) = _ from he.2]95 have l10 : Real.log 10 = Real.log 2 + Real.log 5 := by96 rw [← Real.log_mul (by norm_num) (by norm_num)]; norm_num97 have l9 : Real.log 9 = 2*Real.log 3 := by98 rw [show (9:ℝ) = 3^2 by norm_num, Real.log_pow]; norm_num99 unfold exactDeficit100 rw [Real.log_div (by norm_num) (by norm_num) (x := 1) (y := 2),101 Real.log_div (by norm_num) (by norm_num) (x := 1) (y := 10),102 Real.log_div (by norm_num) (by norm_num) (x := 2) (y := 5),103 Real.log_div (by norm_num) (by norm_num) (x := 9) (y := 10), Real.log_one, l10, l9]104 ring105106end SubentropyCertificates.QuantumCounterexample
Axioms used
Choose a statement to see which axioms its proof uses.