Pratik Patil

TernaryCurveFormula.lean

1module2public import SubentropyCertificates.ClassicalCurve3import all SubentropyCertificates.CounterexampleIntegral45/-! The repeated-coordinate logarithm formula for the ternary curve used in Table A1. -/6@[expose] public section7noncomputable section8open MeasureTheory Set9namespace SubentropyCertificates.TernaryIntervals10open SubentropyCertificates.ClassicalCurve SubentropyCertificates.QuantumCounterexample11open D5.S3.Quantum.Subentropy.Basic1213private theorem repeat_kernel {b s : ℝ} (hb : 0 < b) (hb' : b < 1/3) (hs : 0 < s) :14    let a := 1-2*b15    let A := a^3/(a-b)^216    s/(1+s) - s/(s+a)*(s/(s+b)*(s/(s+b))) =17    A*diff a 1 s + (1-A)*diff b 1 s + b^3/(a-b)*sqInv b s := by18  dsimp only19  have ha : 0 < s+(1-2*b) := by linarith20  have hd : 0 < 1-2*b-b := by linarith21  have hs' : 0 < s+b := by linarith22  unfold diff sqInv23  field_simp24  ring2526/-- For a repeated eigenvalue b, the last rational term is the confluent contribution. -/27theorem ternary_curve_log {b : ℝ} (hb : 0 < b) (hb' : b < 1/3) :28    let a := 1-2*b29    let A := a^3/(a-b)^230    phi 1 (2*b) = -A*Real.log a + (A-1)*Real.log b + b^2/(a-b) := by31  let a := 1-2*b32  let A := a^3/(a-b)^233  have ha : 0 < a := by dsimp [a]; linarith34  have hA := eval_scale A (eval_diff a 1 ha (by dsimp [a]; linarith))35  have hB := eval_scale (1-A) (eval_diff b 1 hb (by linarith))36  have hC := eval_scale (b^3/(a-b)) (eval_sq b hb)37  have h := eval_add (eval_add hA hB) hC38  let f := fun s : ℝ ↦ A*diff a 1 s + (1-A)*diff b 1 s + b^3/(a-b)*sqInv b s39  have he : phi 1 (2*b) = ∫ s in Ioi (0:ℝ), f s := by40    unfold phi classicalSubentropy matrixSubentropy41    apply setIntegral_congr_fun measurableSet_Ioi42    intro s hs43    rw [kernel_diagonal _ _ hs.ne']44    rw [← show s/(1+s) - s/(s+a)*(s/(s+b)*(s/(s+b))) = f s from repeat_kernel hb hb' hs]45    simp [Fintype.prod_option,extremalVector,pow_two,a]46    have hsa : 0 < s+(1-2*b) := by linarith [show 0 < s from hs]47    have hsb : 0 < s+b := add_pos hs hb48    field_simp [hsa.ne',hsb.ne']49  rw [he,show (∫ s in Ioi (0:ℝ), f s) = _ from h.2,Real.log_one]50  dsimp only51  change _ = -A*Real.log a + (A-1)*Real.log b + b^2/(a-b)52  have hd : a-b ≠ 0 := by dsimp [a]; linarith53  field_simp54  ring5556end SubentropyCertificates.TernaryIntervals

Axioms used

Choose a statement to see which axioms its proof uses.