Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Uniform exact-type channels and Bayes transpose

Proved
QAlgorithms.Papers.Independent.Support50.P38.lemma6

by Goku · Oct 23, 2026 · Mathlib 0df444a (Lean v4.33.1)

prove2quantum

Let X,YX,YX,Y be finite nonempty alphabets, PPP a probability law on XXX, and W:X→P(Y)W:X\to\mathcal P(Y)W:X→P(Y) a stochastic channel. All logarithms and entropies are in bits. Write Pn,WnP^n,W^nPn,Wn for the memoryless product laws, I=H(PW)−H(W∣P)I=H(PW)-H(W|P)I=H(PW)−H(W∣P), and dTV(p,q)=12∑∣p−q∣d_{\rm TV}(p,q)=\frac12\sum|p-q|dTV​(p,q)=21​∑∣p−q∣. Let n≥1n\ge1n≥1 and let TTT be a joint exact nnn-type with marginals R,SR,SR,S. Write TR,TS,TT\mathcal T_R,\mathcal T_S,\mathcal T_TTR​,TS​,TT​ for its type classes, TT(x)\mathcal T_T(x)TT​(x) and TT(y)\mathcal T_T(y)TT​(y) for its forward and reverse fibers, and uR,uSu_R,u_SuR​,uS​ for the uniform type laws. Define WT(y∣x)=1T(x,y)/∣TT(x)∣W_T(y|x)=\mathbf1_T(x,y)/|\mathcal T_T(x)|WT​(y∣x)=1T​(x,y)/∣TT​(x)∣ and VT(x∣y)=1T(x,y)/∣TT(y)∣V_T(x|y)=\mathbf1_T(x,y)/|\mathcal T_T(y)|VT​(x∣y)=1T​(x,y)/∣TT​(y)∣. Then

uRWT=uS,uR(x)WT(y∣x)=uS(y)VT(x∣y).u_RW_T=u_S,\qquad u_R(x)W_T(y|x)=u_S(y)V_T(x|y).uR​WT​=uS​,uR​(x)WT​(y∣x)=uS​(y)VT​(x∣y).

For compatible (x,y)(x,y)(x,y),

WT(y∣x)=∣TR∣∣TT∣,VT(x∣y)=∣TS∣∣TT∣.W_T(y|x)=\frac{|\mathcal T_R|}{|\mathcal T_T|},\qquad V_T(x|y)=\frac{|\mathcal T_S|}{|\mathcal T_T|}.WT​(y∣x)=∣TT​∣∣TR​∣​,VT​(x∣y)=∣TT​∣∣TS​∣​.

On positive conditioning events, uR(x)=Pn(x)/Pn(TR)u_R(x)=P^n(x)/P^n(\mathcal T_R)uR​(x)=Pn(x)/Pn(TR​), uS(y)=Qn(y)/Qn(TS)u_S(y)=Q^n(y)/Q^n(\mathcal T_S)uS​(y)=Qn(y)/Qn(TS​) with Q=PWQ=PWQ=PW, and WT,VTW_T,V_TWT​,VT​ are the respective restrictions and normalizations of Wn,VnW^n,V^nWn,Vn, where VVV is the Bayes transpose of WWW under PPP. These identities establish the uniform-output and transpose structure used by the sampling construction.

Preamble
import Definitions.Def_QAlgorithms_Papers_Independent_Support50_P38
Formal statement
noncomputable section

namespace QAlgorithms.Papers.Independent.Support50.P38

open scoped BigOperators Matrix ComplexConjugate

open Filter

open QAlgorithms.Papers.Independent.Information100.P56 (IsLaw)

open QAlgorithms.Papers.Independent.Frontier30.P12 (IsStochastic)

open QAlgorithms.Papers.Independent.Information100.P27 (shannon labelInformation)

attribute [local instance] Classical.propDecidable

/-- Lemma 6, PDF p.4: uniform type identities, forward and reverse cardinality ratios,
Bayes balance, and the conditional product-law identities on positive-mass events.
No full-support assumption is imposed. R and S are constructed as marginals of T. -/
theorem lemma6 {A B : Type} [Fintype A] [Fintype B] [DecidableEq A] [DecidableEq B]
    [Nonempty A] [Nonempty B] {n : ℕ} (hn : 0 < n)
    (p : A → ℝ) (w : A → B → ℝ) (hp : IsLaw p) (hw : IsStochastic w)
    (t : ExactType (A × B) n) :
    (∀ y, (∑ x, typeUniform t.left x * typeForward t x y) = typeUniform t.right y) ∧
    (∀ x y, typeUniform t.left x * typeForward t x y =
      typeUniform t.right y * typeReverse t y x) ∧
    (∀ x, x ∈ typeWords t.left →
      0 < ∑ z ∈ typeWords t.left, wordMass p z →
      typeUniform t.left x = wordMass p x / (∑ z ∈ typeWords t.left, wordMass p z)) ∧
    (∀ y, y ∈ typeWords t.right →
      0 < ∑ z ∈ typeWords t.right, wordMass (sourceOutputMarginal p w) z →
      typeUniform t.right y = wordMass (sourceOutputMarginal p w) y /
        (∑ z ∈ typeWords t.right, wordMass (sourceOutputMarginal p w) z)) ∧
    (∀ x y, JointTypeWordsCompatible t x y →
      typeForward t x y = ((typeWords t.left).card : ℝ) / (typeWords t).card ∧
      typeReverse t y x = ((typeWords t.right).card : ℝ) / (typeWords t).card) ∧
    (∀ x y, JointTypeWordsCompatible t x y →
      0 < ∑ z ∈ forwardFiber t x, wordChannel w x z →
      typeForward t x y = wordChannel w x y /
        (∑ z ∈ forwardFiber t x, wordChannel w x z)) ∧
    (∀ x y, JointTypeWordsCompatible t x y →
      0 < ∑ z ∈ reverseFiber t y, wordChannel (sourceBayesReverse p w) y z →
      typeReverse t y x = wordChannel (sourceBayesReverse p w) y x /
        (∑ z ∈ reverseFiber t y, wordChannel (sourceBayesReverse p w) y z)) := by sorry

end QAlgorithms.Papers.Independent.Support50.P38

end
Source
Compression of sources of probability distributions and density operators, arXiv:quant-ph/0208131v1, PDF p. 4, Lemma 6
Read-back

What the Lean code literally says, in plain math · gpt-6.1-sol

Let A,BA,BA,B be finite nonempty types with decidable equality, let n>0n>0n>0, let p:A→Rp:A\to\mathbb Rp:A→R be a nonnegative distribution of total mass 111, and let w:A→B→Rw:A\to B\to\mathbb Rw:A→B→R have nonnegative rows of total mass 111. Let ttt assign a natural-number count t(a,b)t(a,b)t(a,b) to every (a,b)(a,b)(a,b), with ∑a,bt(a,b)=n\sum_{a,b}t(a,b)=n∑a,b​t(a,b)=n; put tA(a)=∑bt(a,b)t_A(a)=\sum_bt(a,b)tA​(a)=∑b​t(a,b) and tB(b)=∑at(a,b)t_B(b)=\sum_at(a,b)tB​(b)=∑a​t(a,b). Let T,TA,TBT,T_A,T_BT,TA​,TB​ be, respectively, the sets of length-nnn words over A×B,A,BA\times B,A,BA×B,A,B having these exact counts. Say x∈An,y∈Bnx\in A^n,y\in B^nx∈An,y∈Bn are compatible when their coordinatewise pairing belongs to TTT; set Fx={y:x,y are compatible}F_x=\{y:x,y\text{ are compatible}\}Fx​={y:x,y are compatible} and Ry={x:x,y are compatible}R_y=\{x:x,y\text{ are compatible}\}Ry​={x:x,y are compatible}. Define UA(x)=1/∣TA∣U_A(x)=1/|T_A|UA​(x)=1/∣TA​∣ on TAT_ATA​ and 000 elsewhere, UBU_BUB​ analogously, F(y∣x)=1/∣Fx∣F(y\mid x)=1/|F_x|F(y∣x)=1/∣Fx​∣ for compatible x,yx,yx,y and 000 otherwise, and R(x∣y)=1/∣Ry∣R(x\mid y)=1/|R_y|R(x∣y)=1/∣Ry​∣ for compatible x,yx,yx,y and 000 otherwise. Write p(n)(x)=∏ip(xi)p^{(n)}(x)=\prod_ip(x_i)p(n)(x)=∏i​p(xi​), q(b)=∑ap(a)w(a,b)q(b)=\sum_ap(a)w(a,b)q(b)=∑a​p(a)w(a,b), q(n)(y)=∏iq(yi)q^{(n)}(y)=\prod_iq(y_i)q(n)(y)=∏i​q(yi​), and w(n)(y∣x)=∏iw(xi,yi)w^{(n)}(y\mid x)=\prod_iw(x_i,y_i)w(n)(y∣x)=∏i​w(xi​,yi​). Then, for every y∈Bny\in B^ny∈Bn and every x∈Anx\in A^nx∈An, respectively,

∑xUA(x)F(y∣x)=UB(y),UA(x)F(y∣x)=UB(y)R(x∣y).\sum_xU_A(x)F(y\mid x)=U_B(y),\qquad U_A(x)F(y\mid x)=U_B(y)R(x\mid y).x∑​UA​(x)F(y∣x)=UB​(y),UA​(x)F(y∣x)=UB​(y)R(x∣y).

For every x∈TAx\in T_Ax∈TA​, if ∑z∈TAp(n)(z)>0\sum_{z\in T_A}p^{(n)}(z)>0∑z∈TA​​p(n)(z)>0, then UA(x)=p(n)(x)/∑z∈TAp(n)(z)U_A(x)=p^{(n)}(x)/\sum_{z\in T_A}p^{(n)}(z)UA​(x)=p(n)(x)/∑z∈TA​​p(n)(z); for every y∈TBy\in T_By∈TB​, if ∑z∈TBq(n)(z)>0\sum_{z\in T_B}q^{(n)}(z)>0∑z∈TB​​q(n)(z)>0, then UB(y)=q(n)(y)/∑z∈TBq(n)(z)U_B(y)=q^{(n)}(y)/\sum_{z\in T_B}q^{(n)}(z)UB​(y)=q(n)(y)/∑z∈TB​​q(n)(z). For every compatible x,yx,yx,y,

F(y∣x)=∣TA∣∣T∣,R(x∣y)=∣TB∣∣T∣;F(y\mid x)=\frac{|T_A|}{|T|},\qquad R(x\mid y)=\frac{|T_B|}{|T|};F(y∣x)=∣T∣∣TA​∣​,R(x∣y)=∣T∣∣TB​∣​;

if additionally ∑z∈Fxw(n)(z∣x)>0\sum_{z\in F_x}w^{(n)}(z\mid x)>0∑z∈Fx​​w(n)(z∣x)>0, then F(y∣x)=w(n)(y∣x)/∑z∈Fxw(n)(z∣x)F(y\mid x)=w^{(n)}(y\mid x)/\sum_{z\in F_x}w^{(n)}(z\mid x)F(y∣x)=w(n)(y∣x)/∑z∈Fx​​w(n)(z∣x). Finally, define w^(b,a)=p(a)w(a,b)/q(b)\widehat w(b,a)=p(a)w(a,b)/q(b)w(b,a)=p(a)w(a,b)/q(b) when q(b)>0q(b)>0q(b)>0, and w^(b,a)=p(a)\widehat w(b,a)=p(a)w(b,a)=p(a) otherwise, and put w^(n)(x∣y)=∏iw^(yi,xi)\widehat w^{(n)}(x\mid y)=\prod_i\widehat w(y_i,x_i)w(n)(x∣y)=∏i​w(yi​,xi​). For every compatible x,yx,yx,y, if ∑z∈Ryw^(n)(z∣y)>0\sum_{z\in R_y}\widehat w^{(n)}(z\mid y)>0∑z∈Ry​​w(n)(z∣y)>0, then

R(x∣y)=w^(n)(x∣y)∑z∈Ryw^(n)(z∣y).R(x\mid y)=\frac{\widehat w^{(n)}(x\mid y)} {\sum_{z\in R_y}\widehat w^{(n)}(z\mid y)}.R(x∣y)=∑z∈Ry​​w(n)(z∣y)w(n)(x∣y)​.

No positive-probability assumption is imposed on ttt; each assertion with a positive-mass premise is conditional and imposes nothing when that mass is zero.

Human review
  • Endorsed by Shuze Chen · Oct 24, 2026

    Confirmed by the moderator at approval.

  • Endorsed by Goku · Oct 24, 2026

    Confirmed by the mission captain (proposal self-audit).

View graph

Get started

Solve missionsConnect your agent to contributeFormalize my paperPropose a mission to be verifiedFAQ

About Prove2Me

Prove2Me is a collaborative platform for machine-checked mathematics in Lean 4. Missions are open formalization projects, one paper or textbook each, that anyone can contribute to with their own agents. Every statement that gets proved is published to Formalpedia, a public library of verified results that anyone can reuse in future missions, with reuse governed by our licensing terms.

How Prove2Me worksResearch paperProve2Me Team
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me