Pratik Patil

CurveInverse.lean

1module23public import SubentropyCertificates.OptimalGuessing4public import Mathlib.Topology.Order.IntermediateValue56/-! The genuine inverse on the increasing branch, including both endpoints. -/78@[expose] public section9noncomputable section10set_option autoImplicit false11set_option backward.isDefEq.respectTransparency false12open Matrix Set13open scoped BigOperators1415namespace SubentropyCertificates.Discrimination16open D5.S3.Quantum.Foundation.FiniteStateChannel17open D5.S3.Quantum.Subentropy.ClassicalQuantumGram18open D5.S3.Quantum.Subentropy.GuessingProbability19open SubentropyCertificates.ClassicalCurve2021def curveRange (m : ℕ) : Set ℝ := Icc 0 (phi m (uniformError m))2223theorem phi_maps_to_curveRange (m : ℕ) {e : ℝ} (he : e ∈ Icc 0 (uniformError m)) :24    phi m e ∈ curveRange m := by25  have h0 := (phi_strictMono m).monotoneOn26    (show (0 : ℝ) ∈ Icc 0 (uniformError m) from ⟨le_rfl, (uniformError_mem m).1⟩) he he.127  rw [phi_zero] at h028  exact ⟨h0, phi_le_uniform_max m ⟨he.1, he.2.trans (uniformError_mem m).2⟩⟩2930theorem curveRange_zero (m : ℕ) : (0 : ℝ) ∈ curveRange m := by31  have h := phi_maps_to_curveRange m32    (show (0 : ℝ) ∈ Icc 0 (uniformError m) from ⟨le_rfl, (uniformError_mem m).1⟩)33  simpa only [phi_zero] using h3435theorem curveRange_upper (m : ℕ) : phi m (uniformError m) ∈ curveRange m :=36  phi_maps_to_curveRange m ⟨(uniformError_mem m).1, le_rfl⟩3738theorem phi_preimage_exists (m : ℕ) {q : ℝ} (hq : q ∈ curveRange m) :39    ∃ e ∈ Icc 0 (uniformError m), phi m e = q := by40  have hsub : Icc (0 : ℝ) (uniformError m) ⊆ Icc (0 : ℝ) 1 :=41    fun _ he => ⟨he.1, he.2.trans (uniformError_mem m).2⟩42  have hc := (phi_continuous m).mono hsub43  have hsurj := hc.surjOn_Icc44    (show (0 : ℝ) ∈ Icc 0 (uniformError m) from ⟨le_rfl, (uniformError_mem m).1⟩)45    (show uniformError m ∈ Icc 0 (uniformError m) from ⟨(uniformError_mem m).1, le_rfl⟩)46  apply hsurj47  simpa only [curveRange, phi_zero] using hq4849theorem phi_preimage_unique (m : ℕ) {e f : ℝ}50    (he : e ∈ Icc 0 (uniformError m)) (hf : f ∈ Icc 0 (uniformError m))51    (h : phi m e = phi m f) : e = f :=52  (phi_strictMono m).injOn he hf h5354/-- The inverse is defined only with a proof that its argument lies in the55actual range of the increasing branch; no value outside that range is used. -/56def phiInverse (m : ℕ) (q : ℝ) (hq : q ∈ curveRange m) : ℝ :=57  Classical.choose (phi_preimage_exists m hq)5859theorem phiInverse_mem (m : ℕ) (q : ℝ) (hq : q ∈ curveRange m) :60    phiInverse m q hq ∈ Icc 0 (uniformError m) :=61  (Classical.choose_spec (phi_preimage_exists m hq)).16263theorem phi_phiInverse (m : ℕ) (q : ℝ) (hq : q ∈ curveRange m) :64    phi m (phiInverse m q hq) = q :=65  (Classical.choose_spec (phi_preimage_exists m hq)).26667theorem phiInverse_phi (m : ℕ) (e : ℝ) (he : e ∈ Icc 0 (uniformError m)) :68    phiInverse m (phi m e) (phi_maps_to_curveRange m he) = e :=69  phi_preimage_unique m (phiInverse_mem m _ _) he (phi_phiInverse m _ _)7071theorem phiInverse_zero (m : ℕ) : phiInverse m 0 (curveRange_zero m) = 0 := by72  apply phi_preimage_unique m (phiInverse_mem m _ _)73    (show (0 : ℝ) ∈ Icc 0 (uniformError m) from ⟨le_rfl, (uniformError_mem m).1⟩)74  rw [phi_phiInverse, phi_zero]7576theorem phiInverse_upper (m : ℕ) :77    phiInverse m (phi m (uniformError m)) (curveRange_upper m) = uniformError m :=78  phiInverse_phi m _ ⟨(uniformError_mem m).1, le_rfl⟩7980theorem phiInverse_strictMono (m : ℕ) {q r : ℝ}81    (hq : q ∈ curveRange m) (hr : r ∈ curveRange m) (hqr : q < r) :82    phiInverse m q hq < phiInverse m r hr := by83  by_contra hn84  have h := (phi_strictMono m).monotoneOn (phiInverse_mem m r hr)85    (phiInverse_mem m q hq) (le_of_not_gt hn)86  rw [phi_phiInverse, phi_phiInverse] at h87  exact (not_le_of_gt hqr) h8889variable {X B : Type*} [Fintype X] [DecidableEq X] [Fintype B] [DecidableEq B]9091theorem conditional_subentropy_range (m : ℕ) (hn : Fintype.card X = m + 2)92    (p : X → ℝ) (hp : ∀ x, 0 ≤ p x) (hs : ∑ x, p x = 1)93    (ρ : X → DensityState B) : conditionalSubentropy p hp hs ρ ∈ curveRange m := by94  have h := optimal_discrimination_bound m hn p hp hs ρ95  exact ⟨h.1, h.2.1.trans (phi_maps_to_curveRange m h.2.2).2⟩9697theorem inverse_discrimination_bound (m : ℕ) (hn : Fintype.card X = m + 2)98    (p : X → ℝ) (hp : ∀ x, 0 ≤ p x) (hs : ∑ x, p x = 1)99    (ρ : X → DensityState B) :100    phiInverse m (conditionalSubentropy p hp hs ρ) (conditional_subentropy_range m hn p hp hs ρ)101      ≤ 1 - pGuess p ρ := by102  apply error_threshold_lower_bound m hn p hp hs ρ _ (phiInverse_mem m _ _)103  exact (phi_phiInverse m _ _).le104105end SubentropyCertificates.Discrimination

Axioms used

Choose a statement to see which axioms its proof uses.