Pratik Patil

CyclicTable.lean

1module23public import SubentropyCertificates.CyclicSpectra4public import SubentropyCertificates.CyclicGuessing5public import SubentropyCertificates.CurveInverse67/-! The one-parameter family of Table A1 and its exact endpoint values. -/8@[expose] public section9noncomputable section10set_option autoImplicit false11set_option backward.isDefEq.respectTransparency false12open Set13open scoped BigOperators14namespace SubentropyCertificates.Cyclic15open SubentropyCertificates.ClassicalCurve SubentropyCertificates.Discrimination16open D5.S3.Quantum.Subentropy.ClassicalQuantumGram D5.S3.Quantum.Subentropy.GuessingProbability1718def tableWeights (r : ℝ) (j : Three) : ℝ := if j = 0 then 1-2*r else r1920theorem table_probability {r : ℝ} (hr : r ∈ Icc 0 (1/3)) :21    tableWeights r ∈ probabilitySimplex Three := by22  refine ⟨fun j ↦ ?_, ?_⟩23  · unfold tableWeights24    split <;> linarith [hr.1,hr.2]25  · change (∑ j : Fin 3, tableWeights r j) = 126    rw [Fin.sum_univ_three]27    norm_num [tableWeights, show (2 : Three) ≠ 0 by decide]28    ring2930theorem table_weights_subentropy (r : ℝ) : classicalSubentropy (tableWeights r) = phi 1 (2*r) := by31  let e : Three ≃ Option (Fin 2) := finSuccEquiv 232  have h : tableWeights r = extremalVector 1 (2*r) ∘ e := by33    funext i34    change (if (i : Fin 3) = 0 then 1-2*r else r) = _35    refine Fin.cases ?_ (fun j ↦ ?_) i36    · change (if (0 : Fin 3)=0 then 1-2*r else r) = extremalVector 1 (2*r) (finSuccEquiv 2 0)37      rw [finSuccEquiv_zero]38      simp [extremalVector]39    · change (if j.succ=0 then 1-2*r else r) = extremalVector 1 (2*r) (finSuccEquiv 2 j.succ)40      rw [finSuccEquiv_succ]41      simp [extremalVector, Fin.succ_ne_zero j]42  exact (congrArg classicalSubentropy h).trans (classical_subentropy_reindex _ e)4344def tableQ (r : ℝ) := phi 1 (uniformError 1) - phi 1 (2*r)4546def tableError (r : ℝ) := 1 - (Real.sqrt (1-2*r) + 2 * Real.sqrt r)^2/34748/-- The linear bound and the optimal error for every parameter in Table A1. -/49theorem cyclic_table_values {r : ℝ} (hr : r ∈ Icc 0 (1/3)) :50    let p := tableWeights r51    let ρ := signalState p (table_probability hr).1 (table_probability hr).252    conditionalSubentropy prior prior_nonneg prior_sum ρ = tableQ r ∧53      1 - pGuess prior ρ = tableError r := by54  dsimp only55  rw [cyclic_conditional_subentropy, cyclic_guessing_probability, table_weights_subentropy]56  constructor57  · rw [tableQ, phi_uniform_endpoint]58    norm_num59  · change 1 - (∑ j : Fin 3, Real.sqrt (tableWeights r j))^2 / 3 = _60    rw [Fin.sum_univ_three]61    norm_num [tableWeights, tableError, show (2 : Three) ≠ 0 by decide]62    ring6364/-- At r=0 the inverse is 2/3 and the optimal error is 2/3. At r=1/3 both are zero. -/65theorem cyclic_table_endpoints :66    tableError 0 = 2/3 ∧ tableError (1/3) = 0 ∧67    tableQ 0 = Real.log 3 - 5/6 ∧ tableQ (1/3) = 0 ∧68    (∀ h, phiInverse 1 (tableQ 0) h = 2/3) ∧69    (∀ h, phiInverse 1 (tableQ (1/3)) h = 0) := by70  have hx : uniformError 1 = 2/3 := by norm_num [uniformError]71  have h0 : tableQ 0 = phi 1 (uniformError 1) := by simp [tableQ, phi_zero]72  have h1 : tableQ (1/3) = 0 := by rw [tableQ, hx]; norm_num73  refine ⟨by norm_num [tableError], ?_, ?_, h1, ?_, ?_⟩74  · rw [tableError, show 1-2*(1/3:ℝ) = 1/3 by norm_num]75    nlinarith [Real.sq_sqrt (by norm_num : (0 : ℝ) ≤ 1/3)]76  · rw [h0, phi_uniform_endpoint]77    norm_num [harmonic_succ, harmonic_zero]78    ring79  · rw [h0]80    intro h81    exact (phiInverse_upper 1).trans hx82  · rw [h1]83    intro h84    exact phiInverse_zero 18586end SubentropyCertificates.Cyclic87

Axioms used

Choose a statement to see which axioms its proof uses.