module public import SubentropyCertificates.UniformAncillaCurveLimit public import SubentropyCertificates.CalibratedInverse public import SubentropyCertificates.QuadraticDiscrimination /-! Convergence of the calibrated inverse on the closed quadratic range in Corollary 26. -/ @[expose] public section noncomputable section open Filter Set open scoped BigOperators Topology namespace SubentropyCertificates.AncillaLimit open D5.S3.Quantum.Foundation.FiniteStateChannel (DensityState) open D5.S3.Quantum.Information.PartialTraceMutualInformation (productState) open D5.S3.Quantum.Subentropy.ClassicalQuantumGram (conditionalSubentropy) open SubentropyCertificates.AncillaCalibration open SubentropyCertificates.ClassicalCurve (uniformError) open SubentropyCertificates.Quadratic (curve radius inverse statistic) open SubentropyCertificates.SpectralContinuity (maximallyMixed) /-- At every admissible error u, scaled arguments tending to g(u) have inverse values tending to u. Interval bounds supply the outer side of the bracket at the endpoints. -/ theorem uniform_inverse_at_curve_tendsto (m : ℕ) (q : ℕ → ℝ) (hq : ∀ k, q k ∈ calibratedCurveRange (maximallyMixed (Fin (k + 1))) m) {u : ℝ} (hu : u ∈ Icc 0 (uniformError m)) (hlim : Tendsto (fun k : ℕ ↦ ((k + 1 : ℕ) : ℝ) * q k) atTop (𝓝 (curve m u))) : Tendsto (fun k ↦ calibratedPhiInverse (maximallyMixed (Fin (k + 1))) m (q k) (hq k)) atTop (𝓝 u) := by let ν := fun k : ℕ ↦ maximallyMixed (Fin (k + 1)) let x := fun k ↦ calibratedPhiInverse (ν k) m (q k) (hq k) have hx (k) := calibratedPhiInverse_spec (ν k) m (q k) (hq k) have mono : StrictMonoOn (curve m) (Icc 0 (uniformError m)) := by simpa only [Quadratic.radius_eq] using Quadratic.curve_strict m change Tendsto x atTop (𝓝 u) apply tendsto_order.mpr constructor · intro a ha by_cases hneg : a < 0 · exact .of_forall fun k ↦ hneg.trans_le (hx k).1.1 have hmem : a ∈ Icc 0 (uniformError m) := ⟨le_of_not_gt hneg, ha.le.trans hu.2⟩ have hlt := (uniform_ancilla_curve_tendsto m hmem).eventually_lt hlim (mono hmem hu ha) filter_upwards [hlt] with k hk have hc : calibratedPhi (ν k) m a < q k := (mul_lt_mul_iff_right₀ (by positivity : 0 < ((k + 1 : ℕ) : ℝ))).mp hk rw [← (hx k).2] at hc exact ((calibratedPhi_strictMono (ν k) m).lt_iff_lt hmem (hx k).1).mp hc · intro b hb by_cases hout : uniformError m < b · exact .of_forall fun k ↦ (hx k).1.2.trans_lt hout have hmem : b ∈ Icc 0 (uniformError m) := ⟨hu.1.trans hb.le, le_of_not_gt hout⟩ have hlt := hlim.eventually_lt (uniform_ancilla_curve_tendsto m hmem) (mono hu hmem hb) filter_upwards [hlt] with k hk have hc : q k < calibratedPhi (ν k) m b := (mul_lt_mul_iff_right₀ (by positivity : 0 < ((k + 1 : ℕ) : ℝ))).mp hk rw [← (hx k).2] at hc exact ((calibratedPhi_strictMono (ν k) m).lt_iff_lt (hx k).1 hmem).mp hc /-- The two endpoint limits hold for arbitrary sequences of admissible arguments, including sequences whose terms are all strictly inside the respective curve ranges. -/ theorem uniform_inverse_endpoint_limits (m : ℕ) (q : ℕ → ℝ) (hq : ∀ k, q k ∈ calibratedCurveRange (maximallyMixed (Fin (k + 1))) m) : let z := fun k : ℕ ↦ ((k + 1 : ℕ) : ℝ) * q k let x := fun k ↦ calibratedPhiInverse (maximallyMixed (Fin (k + 1))) m (q k) (hq k) (Tendsto z atTop (𝓝 0) → Tendsto x atTop (𝓝 0)) ∧ (Tendsto z atTop (𝓝 (radius m / 2)) → Tendsto x atTop (𝓝 (uniformError m))) := by have hr := Quadratic.radius_pos m have hu : 0 ≤ uniformError m := (Quadratic.radius_eq m) ▸ hr.le have he : curve m (uniformError m) = radius m / 2 := by rw [← Quadratic.radius_eq, curve] field_simp [hr.ne'] ring constructor · intro h apply uniform_inverse_at_curve_tendsto m q hq (show (0 : ℝ) ∈ Icc 0 (uniformError m) from ⟨le_rfl, hu⟩) simpa only [curve, zero_pow (by decide : 2 ≠ 0), zero_div, sub_zero] using h · intro h apply uniform_inverse_at_curve_tendsto m q hq (show uniformError m ∈ Icc 0 (uniformError m) from ⟨hu, le_rfl⟩) rwa [he] variable {X B : Type*} [Fintype X] [DecidableEq X] [Fintype B] [DecidableEq B] /-- The calibrated inverse evaluated at the actual conditional subentropy of an ensemble after adjoining the maximally mixed ancillary state of dimension k+1. -/ def ensembleCalibratedInverse (m : ℕ) (hn : Fintype.card X = m + 2) (p : X → ℝ) (hp : ∀ x, 0 ≤ p x) (hs : ∑ x, p x = 1) (ρ : X → DensityState B) (k : ℕ) : ℝ := let ν := maximallyMixed (Fin (k + 1)) calibratedPhiInverse ν m (conditionalSubentropy p hp hs (fun x ↦ productState (ρ x) ν)) (conditional_product_mem_calibratedRange ν m hn p hp hs ρ) /-- The limit of the calibrated inverse is the inverse quadratic evaluated at the original ensemble's purity statistic. The statistic may take either endpoint value. -/ theorem uniform_ancilla_inverse_tendsto (m : ℕ) (hn : Fintype.card X = m + 2) (p : X → ℝ) (hp : ∀ x, 0 ≤ p x) (hs : ∑ x, p x = 1) (ρ : X → DensityState B) : Tendsto (ensembleCalibratedInverse m hn p hp hs ρ) atTop (𝓝 (inverse m (statistic p hp hs ρ))) := by let c := statistic p hp hs ρ have h := (Quadratic.complementary_quadratic_bound m hn p hp hs ρ).1 have hc : c ∈ Icc 0 (radius m / 2) := ⟨h.1, h.2.1.trans (Quadratic.curve_le_max m _)⟩ obtain ⟨hu, hv⟩ := Quadratic.inverse_spec m c hc rw [Quadratic.radius_eq] at hu apply uniform_inverse_at_curve_tendsto m _ (fun k ↦ conditional_product_mem_calibratedRange (maximallyMixed (Fin (k + 1))) m hn p hp hs ρ) hu rw [hv] exact uniform_ancilla_conditional_tendsto p hp hs ρ end SubentropyCertificates.AncillaLimit