Prove2Me
Navigate
DiscoverCollectionsFormalpediaBlogsUsersMomentumMy Missions+
Prove2Me
⌕
Log in
← Formalpedia

Optimal Fock photon counting and total-count threshold

Open
QAlgorithms.Papers.Independent.Intakethird100.P54.fock_counting

by Gohan · Nov 1, 2026 · Mathlib 0df444a (Lean v4.33.1)

prove2quantum

Let M≥1M\ge1M≥1 be the finite number of signal modes and J≥0J\ge0J≥0 the finite number of retained idler modes, on the full optical Fock spaces. The two channels have equal priors, independent vacuum environments, reflectances 0≤R0≤R1≤10\le R_0\le R_1\le10≤R0​≤R1​≤1, field magnitudes rb=Rbr_b=\sqrt{R_b}rb​=Rb​​ and tb=1−Rbt_b=\sqrt{1-R_b}tb​=1−Rb​​, and distinct complex reflection coefficients rbeiθbr_b e^{i\theta_b}rb​eiθb​. Every signal mode sees the same channel; idlers are retained losslessly and environment outputs are inaccessible. Write F\mathcal FF for squared Uhlmann fidelity, PeP_ePe​ for minimum average error over all joint binary receivers, Qs=Tr⁡(ρ0sρ11−s)Q_s=\operatorname{Tr}(\rho_0^s\rho_1^{1-s})Qs​=Tr(ρ0s​ρ11−s​), and Q=min⁡0≤s≤1QsQ=\min_{0\le s\le1}Q_sQ=min0≤s≤1​Qs​, with zero powers interpreted as support projections. Here the common phase is removed, so θ0=θ1=0\theta_0=\theta_1=0θ0​=θ1​=0 and R0<R1R_0<R_1R0​<R1​. Put μ=r0r1+t0t1\mu=r_0r_1+t_0t_1μ=r0​r1​+t0​t1​.

For a multimode Fock input ∣N⟩|\mathbf N\rangle∣N⟩ with total photon number KKK, the returned states are diagonal and commute. The observed occupation j\mathbf jj has conditional law

Pr⁡b(j)=∏m(Nmjm)Rbjm(1−Rb)Nm−jm,0≤jm≤Nm,\Pr_b(\mathbf j)=\prod_m\binom{N_m}{j_m}R_b^{j_m}(1-R_b)^{N_m-j_m},\quad0\le j_m\le N_m,bPr​(j)=m∏​(jm​Nm​​)Rbjm​​(1−Rb​)Nm​−jm​,0≤jm​≤Nm​,

and zero otherwise. Its total T=∑mjmT=\sum_mj_mT=∑m​jm​ has the binomial law Bb(T)=(KT)RbT(1−Rb)K−TB_b(T)=\binom KT R_b^T(1-R_b)^{K-T}Bb​(T)=(TK​)RbT​(1−Rb​)K−T. Photon counting followed by the likelihood decision, assigning equality to one, attains

Pe=12∑T=0Kmin⁡{B0(T),B1(T)}.P_e=\frac12\sum_{T=0}^K\min\{B_0(T),B_1(T)\}.Pe​=21​T=0∑K​min{B0​(T),B1​(T)}.

For 0<R0<R1<10<R_0<R_1<10<R0​<R1​<1 and possible counts T≤KT\le KT≤K, the likelihood ratio is at least one exactly when

T≥Kln⁡[(1−R0)/(1−R1)]ln⁡[R1(1−R0)/(R0(1−R1))].T\ge K\frac{\ln[(1-R_0)/(1-R_1)]}{\ln[R_1(1-R_0)/(R_0(1-R_1))]}.T≥Kln[R1​(1−R0​)/(R0​(1−R1​))]ln[(1−R0​)/(1−R1​)]​.

The optimum depends only on KKK, independently of occupations and mode count; K=0K=0K=0 gives a tie and error 1/21/21/2.

Preamble
import Definitions.Def_QAlgorithms_Papers_Independent_Intakethird100_P54
Formal statement
noncomputable section

open scoped BigOperators ComplexConjugate

open MeasureTheory Filter

namespace QAlgorithms.Papers.Independent.Intakethird100.P54

open QAlgorithms.RealRegisters (Hilbert)

open QAlgorithms.Papers.Independent.Claimed50.P47 (Occupation)

open QAlgorithms.Papers.Independent.Dependency50.P39 (coherentCoefficient)

attribute [local instance] Classical.propDecidable

attribute [local instance] Classical.decEq

/-- Photon counting is optimal and depends only on total Fock photon number,
PDF p.8, (62)–(65). j counts observed photons, whereas source k counts losses.
The logarithmic likelihood rule is restricted to strict interior reflectances. -/
theorem fock_counting {M : ℕ} (hM : 0 < M) (c : Channels)
    (hc : ValidSplitters c) (hr : Reading c) (n : Occupation (Fin M)) :
    (∀ b x y, returned (c b) (fock n) x y =
      if x=y then (countLaw (c b) n x.2 : ℂ) else 0) ∧
    kernelProduct (returned (c false) (fock n)) (returned (c true) (fock n)) =
      kernelProduct (returned (c true) (fock n)) (returned (c false) (fock n)) ∧
    (∀ b j, (∑' q : Occupation (Fin M), if photons q=j then countLaw (c b) n q else 0) =
      totalCountLaw (c b) (photons n) j) ∧
    outputError c (fock n) = countingError c (photons n) ∧
    (∃ E, IsOpticalEffect E ∧ CountsAs E (fun q => decide
      (totalCountLaw (c false) (photons n) (photons q) ≤
        totalCountLaw (c true) (photons n) (photons q))) ∧
      sectorRisk c (fock n) E (1/2) (1/2)=outputError c (fock n)) ∧
    (0 < (c false).reflectance → (c true).reflectance < 1 →
      ∀ j : ℕ, j ≤ photons n →
        ((1 ≤ ((c true).reflectance^j * (1-(c true).reflectance)^(photons n-j)) /
          ((c false).reflectance^j * (1-(c false).reflectance)^(photons n-j))) ↔
        countThreshold c (photons n) ≤ (j : ℝ))) := by sorry

end QAlgorithms.Papers.Independent.Intakethird100.P54

end
Source
Discriminating quantum-optical beam-splitter channels with number-diagonal signal states: Applications to quantum reading and target detection, arXiv:1105.4063v3, PDF p. 8, fock-counting
Read-back

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

Let M>0M>0M>0 be a natural number, let ccc specify splitters with reflectances Rb∈[0,1]R_b\in[0,1]Rb​∈[0,1] and phases ϕb\phi_bϕb​, and assume R0≤R1R_0\le R_1R0​≤R1​, R0eiϕ0≠R1eiϕ1\sqrt{R_0}e^{i\phi_0}\ne\sqrt{R_1}e^{i\phi_1}R0​​eiϕ0​=R1​​eiϕ1​, and ϕ0=ϕ1=0\phi_0=\phi_1=0ϕ0​=ϕ1​=0. Fix n∈NMn\in\mathbb N^Mn∈NM, put K=∑mnmK=\sum_mn_mK=∑m​nm​, and let ∣n⟩|n\rangle∣n⟩ be the unit coordinate vector at (0,n)(0,n)(0,n) in ℓ2(N0×NM;C)\ell^2(\mathbb N^0\times\mathbb N^M;\mathbb C)ℓ2(N0×NM;C), whose idler label set is a singleton. Define ab(q,k)=∏m(qmkm)(Rb)qm−km(1−Rb)kma_b(q,k)=\prod_m\sqrt{\binom{q_m}{k_m}}(\sqrt{R_b})^{q_m-k_m}(\sqrt{1-R_b})^{k_m}ab​(q,k)=∏m​(km​qm​​)​(Rb​​)qm​−km​(1−Rb​​)km​ for k≤qk\le qk≤q, and 000 otherwise; put zb,k(i,q)=∣n⟩(i,q+k)ab(q+k,k)z_{b,k}(i,q)=|n\rangle(i,q+k)a_b(q+k,k)zb,k​(i,q)=∣n⟩(i,q+k)ab​(q+k,k), and ρb(x,y)=∑kzb,k(x)zb,k(y)‾\rho_b(x,y)=\sum_kz_{b,k}(x)\overline{z_{b,k}(y)}ρb​(x,y)=∑k​zb,k​(x)zb,k​(y)​. Let sb,ks_{b,k}sb,k​ be the coefficient function zb,kz_{b,k}zb,k​ as an ℓ2\ell^2ℓ2 vector if square summable, and the zero vector otherwise. For q∈NMq\in\mathbb N^Mq∈NM and j∈Nj\in\mathbb Nj∈N, set

pb(q)={∏m(nmqm)Rbqm(1−Rb)nm−qm,q≤n,0,otherwise,Bb(K,j)={(Kj)Rbj(1−Rb)K−j,j≤K,0,j>K.p_b(q)= \begin{cases} \displaystyle\prod_m\binom{n_m}{q_m}R_b^{q_m}(1-R_b)^{n_m-q_m},&q\le n,\\ 0,&\text{otherwise}, \end{cases} \qquad B_b(K,j)= \begin{cases} \displaystyle\binom KjR_b^j(1-R_b)^{K-j},&j\le K,\\ 0,&j>K. \end{cases}pb​(q)=⎩⎨⎧​m∏​(qm​nm​​)Rbqm​​(1−Rb​)nm​−qm​,0,​q≤n,otherwise,​Bb​(K,j)=⎩⎨⎧​(jK​)Rbj​(1−Rb​)K−j,0,​j≤K,j>K.​

A resolution of a kernel HHH means H(x,y)=∑awaua(x)ua(y)‾H(x,y)=\sum_a w_a u_a(x)\overline{u_a(y)}H(x,y)=∑a​wa​ua​(x)ua​(y)​, with nonnegative summable weights totaling 111, unit ℓ2\ell^2ℓ2 vectors at positive weights, and orthogonality for distinct positive-weight vectors; zero-weight vectors are unrestricted. An effect is a bounded complex-linear operator EEE with ⟨u,Ev⟩=⟨v,Eu⟩‾\langle u,Ev\rangle=\overline{\langle v,Eu\rangle}⟨u,Ev⟩=⟨v,Eu⟩​ and 0≤Re⁡⟨v,Ev⟩≤∥v∥20\le\operatorname{Re}\langle v,Ev\rangle\le\|v\|^20≤Re⟨v,Ev⟩≤∥v∥2. Let e(ρ0,ρ1)e(\rho_0,\rho_1)e(ρ0​,ρ1​) be the real infimum over resolutions (wa,ua),(va,ha)(w_a,u_a),(v_a,h_a)(wa​,ua​),(va​,ha​) and effects of 12∑awa(1−Re⁡⟨ua,Eua⟩)+12∑avaRe⁡⟨ha,Eha⟩\frac12\sum_a w_a(1-\operatorname{Re}\langle u_a,Eu_a\rangle)+\frac12\sum_a v_a\operatorname{Re}\langle h_a,Eh_a\rangle21​∑a​wa​(1−Re⟨ua​,Eua​⟩)+21​∑a​va​Re⟨ha​,Eha​⟩, with empty defining set assigned infimum 000. The assertion is that ρb(x,y)=pb(xs)\rho_b(x,y)=p_b(x_{\mathrm s})ρb​(x,y)=pb​(xs​) when x=yx=yx=y, and 000 otherwise, for every b,x,yb,x,yb,x,y; that the kernel products commute, meaning

∑zρ0(x,z)ρ1(z,y)=∑zρ1(x,z)ρ0(z,y)for every x,y;∑q: ∑mqm=jpb(q)=Bb(K,j)for every b,j;\sum_z\rho_0(x,z)\rho_1(z,y)=\sum_z\rho_1(x,z)\rho_0(z,y) \quad\text{for every }x,y; \qquad \sum_{q:\,\sum_mq_m=j}p_b(q)=B_b(K,j) \quad\text{for every }b,j;z∑​ρ0​(x,z)ρ1​(z,y)=z∑​ρ1​(x,z)ρ0​(z,y)for every x,y;q:∑m​qm​=j∑​pb​(q)=Bb​(K,j)for every b,j;

and that

e(ρ0,ρ1)=12∑j=0Kmin⁡{B0(K,j),B1(K,j)}.e(\rho_0,\rho_1)=\frac12\sum_{j=0}^{K}\min\{B_0(K,j),B_1(K,j)\}.e(ρ0​,ρ1​)=21​j=0∑K​min{B0​(K,j),B1​(K,j)}.

There also exists an effect EEE such that, for every vector vvv and label (i,q)(i,q)(i,q), (Ev)(i,q)=0(Ev)(i,q)=0(Ev)(i,q)=0 if B0(K,∑mqm)≤B1(K,∑mqm)B_0(K,\sum_mq_m)\le B_1(K,\sum_mq_m)B0​(K,∑m​qm​)≤B1​(K,∑m​qm​), and (Ev)(i,q)=v(i,q)(Ev)(i,q)=v(i,q)(Ev)(i,q)=v(i,q) otherwise, and such that

12∑k(∥s0,k∥2−Re⁡⟨s0,k,Es0,k⟩)+12∑kRe⁡⟨s1,k,Es1,k⟩=e(ρ0,ρ1).\frac12\sum_k\left(\|s_{0,k}\|^2-\operatorname{Re}\langle s_{0,k},Es_{0,k}\rangle\right) +\frac12\sum_k\operatorname{Re}\langle s_{1,k},Es_{1,k}\rangle =e(\rho_0,\rho_1).21​k∑​(∥s0,k​∥2−Re⟨s0,k​,Es0,k​⟩)+21​k∑​Re⟨s1,k​,Es1,k​⟩=e(ρ0​,ρ1​).

Finally, if R0>0R_0>0R0​>0 and R1<1R_1<1R1​<1, then every j∈Nj\in\mathbb Nj∈N with j≤Kj\le Kj≤K satisfies

1≤R1j(1−R1)K−jR0j(1−R0)K−j⟺Klog⁡((1−R0)/(1−R1))log⁡ ⁣(R1(1−R0)/(R0(1−R1)))≤j.1\le\frac{R_1^j(1-R_1)^{K-j}}{R_0^j(1-R_0)^{K-j}} \quad\Longleftrightarrow\quad \frac{K\log((1-R_0)/(1-R_1))} {\log\!\left(R_1(1-R_0)/(R_0(1-R_1))\right)} \le j.1≤R0j​(1−R0​)K−jR1j​(1−R1​)K−j​⟺log(R1​(1−R0​)/(R0​(1−R1​)))Klog((1−R0​)/(1−R1​))​≤j.

The vector n=0n=0n=0, hence K=0K=0K=0, is included; all zeroth powers, including 000^000, equal 111. Infinite sums have value 000 if not summable.

Human review
  • Endorsed by Shuze Chen · Nov 1, 2026

    Confirmed by the moderator at approval.

  • Endorsed by Gohan · Nov 1, 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 paper
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me