Pratik Patil

CalibratedMonotonicity.lean

1module23public import SubentropyCertificates.CalibratedCoordinate4public import SubentropyCertificates.CalibratedStrictConcavity5public import SubentropyCertificates.CurveMonotonicity67/-! The calibrated curve has a unique uniform maximum and increases strictly up to it. -/8@[expose] public section9noncomputable section10open Set11open scoped BigOperators1213namespace SubentropyCertificates.AncillaCalibration14open D5.S3.Quantum.Foundation.FiniteStateChannel (DensityState)15open SubentropyCertificates.ClassicalCurve1617variable {C : Type*} [Fintype C] [DecidableEq C]1819/-- Distinct parameters give distinct masses on the selected label, so restriction to the20extremal family preserves strict concavity. -/21theorem calibratedPhi_strictConcave (ν : DensityState C) (m : ℕ) :22    StrictConcaveOn ℝ (Icc (0 : ℝ) 1) (calibratedPhi ν m) := by23  refine ⟨convex_Icc _ _, ?_⟩24  intro u hu v hv huv a b ha hb hab25  have hne : extremalVector m u ≠ extremalVector m v := by26    intro he27    have hn := congrFun he none28    simp only [extremalVector] at hn29    exact huv (by linarith)30  have h := (calibratedSubentropy_strictConcave ν).231    (extremal_probability m hu) (extremal_probability m hv) hne ha hb hab32  simpa only [calibratedPhi, smul_eq_mul, ← extremal_affine m u v a b hab] using h3334private theorem calibrated_fin_le_uniform (ν : DensityState C) (k : ℕ) (p : Fin (k + 1) → ℝ)35    (hp : p ∈ probabilitySimplex (Fin (k + 1))) :36    calibratedSubentropy ν p ≤37      calibratedSubentropy ν (fun _ : Fin (k + 1) ↦ (1 : ℝ) / (k + 1 : ℕ)) := by38  have hk : ((k + 1 : ℕ) : ℝ) ≠ 0 := by positivity39  have hw : ∑ _j : Fin (k + 1), ((k + 1 : ℕ) : ℝ)⁻¹ = 1 := by40    simp only [Finset.sum_const, Finset.card_univ, Fintype.card_fin, nsmul_eq_mul]41    exact mul_inv_cancel₀ hk42  have havg : (∑ j : Fin (k + 1), ((k + 1 : ℕ) : ℝ)⁻¹ • (p ∘ Equiv.addRight j)) =43      fun _ : Fin (k + 1) ↦ (1 : ℝ) / (k + 1 : ℕ) := by44    funext i45    simp only [Finset.sum_apply, Pi.smul_apply, smul_eq_mul, Function.comp_apply,46      Equiv.coe_addRight, ← Finset.mul_sum]47    have hsum := Equiv.sum_comp (Equiv.addLeft i) p48    simp only [Equiv.coe_addLeft] at hsum49    rw [hsum, hp.2]50    simp [one_div]51  have h := (calibratedSubentropy_strictConcave ν).concaveOn.le_map_sum (t := Finset.univ)52    (w := fun _ : Fin (k + 1) ↦ ((k + 1 : ℕ) : ℝ)⁻¹) (p := fun j ↦ p ∘ Equiv.addRight j)53    (fun _ _ ↦ by positivity) hw (fun j _ ↦ simplex_reindex p hp (Equiv.addRight j))54  rw [havg] at h55  simp only [calibratedSubentropy_reindex, smul_eq_mul, Finset.sum_const, Finset.card_univ,56    Fintype.card_fin, nsmul_eq_mul, mul_inv_cancel_left₀ hk] at h57  exact h5859/-- Averaging the label permutations gives the uniform prior at error `1 − 1/n`. -/60theorem calibratedPhi_le_uniform_max (ν : DensityState C) (m : ℕ) {u : ℝ}61    (hu : u ∈ Icc (0 : ℝ) 1) : calibratedPhi ν m u ≤ calibratedPhi ν m (uniformError m) := by62  let e : Fin (m + 2) ≃ Option (Fin (m + 1)) := Fintype.equivOfCardEq (by simp [Nat.add_assoc])63  let p := extremalVector m u64  have h := calibrated_fin_le_uniform ν (m + 1) (p ∘ e)65    (simplex_reindex p (extremal_probability m hu) e)66  rw [calibratedSubentropy_reindex ν p e] at h67  have he := calibratedSubentropy_reindex ν68    (fun _ : Option (Fin (m + 1)) ↦ (1 : ℝ) / (m + 2 : ℕ)) e69  simpa only [calibratedPhi, extremal_uniform] using h.trans_eq he7071/-- The uniform prior is the unique maximizer along the entire calibrated curve. -/72theorem calibratedPhi_lt_uniform_max (ν : DensityState C) (m : ℕ) {u : ℝ}73    (hu : u ∈ Icc (0 : ℝ) 1) (hne : u ≠ uniformError m) :74    calibratedPhi ν m u < calibratedPhi ν m (uniformError m) := by75  have hmax : IsMaxOn (calibratedPhi ν m) (Icc (0 : ℝ) 1) (uniformError m) :=76    fun _ hv ↦ calibratedPhi_le_uniform_max ν m hv77  apply lt_of_le_of_ne (hmax hu)78  intro heq79  have hmu : IsMaxOn (calibratedPhi ν m) (Icc (0 : ℝ) 1) u :=80    fun _ hv ↦ (hmax hv).trans_eq heq.symm81  exact hne ((calibratedPhi_strictConcave ν m).eq_of_isMaxOn hmu hmax hu (uniformError_mem m))8283/-- Proposition 25: the calibrated curve is strictly increasing on the closed error interval. -/84theorem calibratedPhi_strictMono (ν : DensityState C) (m : ℕ) :85    StrictMonoOn (calibratedPhi ν m) (Icc 0 (uniformError m)) := by86  intro u hu v hv huv87  have hue := huv.trans_le hv.288  have hu01 : u ∈ Icc (0 : ℝ) 1 := ⟨hu.1, hu.2.trans (uniformError_mem m).2⟩89  rcases hv.2.lt_or_eq with hve | rfl90  · have hseg : v ∈ openSegment ℝ u (uniformError m) := Ioo_subset_openSegment ⟨huv, hve⟩91    have h := (calibratedPhi_strictConcave ν m).lt_on_openSegment hu01 (uniformError_mem m)92      hue.ne hseg93    simpa only [min_eq_left (calibratedPhi_le_uniform_max ν m hu01)] using h94  · exact calibratedPhi_lt_uniform_max ν m hu01 hue.ne9596end SubentropyCertificates.AncillaCalibration

Axioms used

Choose a statement to see which axioms its proof uses.