module public import SubentropyCertificates.CalibratedCoordinate public import SubentropyCertificates.CalibratedIdenticalPure public import SubentropyCertificates.IdenticalPureSignals /-! Equality witnesses for Proposition 25 at every admissible error. -/ @[expose] public section noncomputable section open Set open scoped BigOperators namespace SubentropyCertificates.AncillaCalibration open D5.S3.Quantum.Foundation.FiniteStateChannel (DensityState) open D5.S3.Quantum.Information.PartialTraceMutualInformation (productState) open D5.S3.Quantum.Subentropy.ClassicalQuantumGram (conditionalSubentropy) open D5.S3.Quantum.Subentropy.GuessingProbability (pGuess) open SubentropyCertificates.ClassicalCurve open SubentropyCertificates.Discrimination variable {X B C : Type*} [Fintype X] [DecidableEq X] [Fintype B] [DecidableEq B] [Fintype C] [DecidableEq C] /-- Any common unit vector and any distinguished label realize the calibrated curve. The prescribed error may be zero or the uniform-prior endpoint. -/ theorem calibrated_curve_attainable (ν : DensityState C) (m : ℕ) (hn : Fintype.card X = m + 2) (i : X) (v : B → ℂ) (hv : ∑ b, star (v b) * v b = 1) (r : ℝ) (hr : r ∈ Icc 0 (uniformError m)) : ∃ (p : X → ℝ) (hp : ∀ x, 0 ≤ p x) (hs : ∑ x, p x = 1), p i = 1 - r ∧ (∀ x, x ≠ i → p x = r / (m + 1 : ℕ)) ∧ 1 - pGuess p (fun _ ↦ pureSignal v hv) = r ∧ conditionalSubentropy p hp hs (fun _ ↦ productState (pureSignal v hv) ν) = calibratedPhi ν m r := by classical let g : X ≃ Option (Fin (m + 1)) := Fintype.equivOfCardEq (by simp [hn, Nat.add_assoc]) let f := g.trans (Equiv.swap (g i) none) have hfi : f i = none := by simp [f] let p := extremalVector m r ∘ f have hp := simplex_reindex _ (extremal_probability_admissible m hr) f have hi : p i = 1 - r := by simp only [p, Function.comp_apply, hfi, extremalVector] have hmax (x : X) : p x ≤ p i := by change extremalVector m r (f x) ≤ extremalVector m r (f i) rw [hfi] exact extremal_none_largest m hr (f x) refine ⟨p, hp.1, hp.2, hi, ?_, ?_, ?_⟩ · intro x hxi have hx : f x ≠ none := fun h ↦ hxi (f.injective (h.trans hfi.symm)) change extremalVector m r (f x) = _ cases h : f x with | none => exact (hx h).elim | some j => rfl · rw [pGuess_identical p hp.1 hp.2 (pureSignal v hv) i hmax, hi] ring · exact (conditional_product_identical_pure p hp.1 hp.2 v hv ν).trans (calibratedSubentropy_reindex ν (extremalVector m r) f) end SubentropyCertificates.AncillaCalibration