Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Transmission-matrix model, output intensity and its segment terms

Definition
Arxiv2011_11825_Basic

by Xeroth · Nov 25, 2026 · Mathlib 0df444a (Lean v4.33.1)

interferenceopticstransmission-matrixwavefront-shaping

Objects of Section 2 and Supplement S1 of Guo, Zhang, Li and Pang (2020), on the transmission matrix (TM) of a scattering medium.

  1. Transmission model (eq. 1). There are NNN input modes (modulator pixels), with complex input field Ein=(E1in,…,ENin)∈CNE^{\mathrm{in}}=(E_1^{\mathrm{in}},\dots,E_N^{\mathrm{in}})\in\mathbb{C}^NEin=(E1in​,…,ENin​)∈CN, and a complex transmission matrix t=(tmi)t=(t_{mi})t=(tmi​) whose rows are indexed by the output modes mmm. The field at output mode mmm is
Emout=∑i=1NtmiEiin.E_m^{\mathrm{out}}=\sum_{i=1}^N t_{mi}E_i^{\mathrm{in}}.Emout​=i=1∑N​tmi​Eiin​.
  1. Transmitted modes. The contribution of input mode iii to output mode mmm is ai=tmiEiin∈Ca_i=t_{mi}E_i^{\mathrm{in}}\in\mathbb{C}ai​=tmi​Eiin​∈C.
  2. Segments. The input modes are divided into kkk disjoint segments Q1,…,QkQ_1,\dots,Q_kQ1​,…,Qk​ covering all NNN modes. This is encoded by a map σ:{1,…,N}→{1,…,k}\sigma:\{1,\dots,N\}\to\{1,\dots,k\}σ:{1,…,N}→{1,…,k} with Qp=σ−1(p)Q_p=\sigma^{-1}(p)Qp​=σ−1(p).
  3. Intensity (eq. 2). Imout=∣Emout∣2I_m^{\mathrm{out}}=|E_m^{\mathrm{out}}|^2Imout​=∣Emout​∣2.
  4. Terms of eq. (3). For segments ppp and qqq, with a⋅b=Re(a b‾)a\cdot b=\mathrm{Re}(a\,\overline{b})a⋅b=Re(ab) the inner product of two phasors a,b∈C≅R2a,b\in\mathbb{C}\cong\mathbb{R}^2a,b∈C≅R2:
    • the self terms Sp=∑i∈Qp∣ai∣2S_p=\sum_{i\in Q_p}|a_i|^2Sp​=∑i∈Qp​​∣ai​∣2;
    • the interference inside QpQ_pQp​, Ap=∑i∈Qp∑j∈Qp, j≠iai⋅ajA_p=\sum_{i\in Q_p}\sum_{j\in Q_p,\,j\ne i}a_i\cdot a_jAp​=∑i∈Qp​​∑j∈Qp​,j=i​ai​⋅aj​;
    • the interference between QpQ_pQp​ and QqQ_qQq​, Cpq=∑i∈Qp∑j∈Qqai⋅ajC_{pq}=\sum_{i\in Q_p}\sum_{j\in Q_q}a_i\cdot a_jCpq​=∑i∈Qp​​∑j∈Qq​​ai​⋅aj​;
    • the bracket of segment QpQ_pQp​, Bp=Sp+Ap+∑q≠pCpqB_p=S_p+A_p+\sum_{q\ne p}C_{pq}Bp​=Sp​+Ap​+∑q=p​Cpq​.

Formalization Note The paper prints the terms as (tmiEiin)2(t_{mi}E_i^{\mathrm{in}})^2(tmi​Eiin​)2 and tmiEiin⋅tmjEjint_{mi}E_i^{\mathrm{in}}\cdot t_{mj}E_j^{\mathrm{in}}tmi​Eiin​⋅tmj​Ejin​ and calls them "inner products" of the modulated modes and "intensity contributions" (Sec. 2, pp. 2-3). They are therefore read as inner products of phasors: the square of aia_iai​ is ∣ai∣2|a_i|^2∣ai​∣2 and ai⋅aj=Re(aiaj‾)a_i\cdot a_j=\mathrm{Re}(a_i\overline{a_j})ai​⋅aj​=Re(ai​aj​​). With this reading the paper's whole printed chain Imout=∣Emout∣2=(∑iai)2=…I_m^{\mathrm{out}}=|E_m^{\mathrm{out}}|^2=(\sum_i a_i)^2=\dotsImout​=∣Emout​∣2=(∑i​ai​)2=… holds. Read instead as complex multiplication, the link ∣Emout∣2=(Emout)2|E_m^{\mathrm{out}}|^2=(E_m^{\mathrm{out}})^2∣Emout​∣2=(Emout​)2 would be false and the terms would not be intensity contributions. The paper's sum limits ∑i=1, i∈QpNp\sum_{i=1,\,i\in Q_p}^{N_p}∑i=1,i∈Qp​Np​​ are read as sums over the NpN_pNp​ modes of QpQ_pQp​. The input modes are indexed by Fin N\mathrm{Fin}\,NFinN and the segments by Fin k\mathrm{Fin}\,kFink, so Q1,…,QkQ_1,\dots,Q_kQ1​,…,Qk​ correspond to the indices 0,…,k−10,\dots,k-10,…,k−1.

Definition code
import Mathlib

/-!
Guo, Zhang, Li and Pang, *Sequential Transmission Matrix Evaluation Via Spatiotemporal
Transmitted Modes Decomposition*, arXiv:2011.11825v1 (2020): the transmission-matrix model of
Section 2 (eqs. (1)-(3)) and of Supplement S1 (eq. (S1)). The input plane carries `N` complex
input modes, the medium is a complex transmission matrix `t` (rows: output modes, columns: input
modes), and the input modes are divided into `k` disjoint segments `Q_1, ..., Q_k`, encoded by
the map `seg` sending each input mode to the index of its segment.
-/

noncomputable section

namespace Arxiv2011_11825

variable {M N k : ℕ}

/-- Section 2, eq. (1), PDF p. 2: the field at output mode `m`,
`E_m^out = ∑_{i=1}^N t_{mi} E_i^in`, for a complex transmission matrix `t` and complex input
field `E`. -/
def outField (t : Matrix (Fin M) (Fin N) ℂ) (E : Fin N → ℂ) (m : Fin M) : ℂ :=
  ∑ i, t m i * E i

/-- Section 2, eq. (2), PDF p. 2: the contribution `t_{mi} E_i^in` of input mode `i` to the field
at output mode `m` (the transmitted mode). -/
def amp (t : Matrix (Fin M) (Fin N) ℂ) (E : Fin N → ℂ) (m : Fin M) (i : Fin N) : ℂ :=
  t m i * E i

/-- Section 2, eq. (2), PDF p. 2: the intensity `I_m^out = |E_m^out|^2` of output mode `m`. -/
def outIntensity (t : Matrix (Fin M) (Fin N) ℂ) (E : Fin N → ℂ) (m : Fin M) : ℝ :=
  Complex.normSq (outField t E m)

/-- Section 2, eq. (3), PDF p. 3, first term of each bracket: `∑_{i ∈ Q_p} (t_{mi} E_i^in)^2`,
the intensity contribution of each mode of segment `Q_p`. The paper calls these terms "inner
products of the modulated input modes themselves" (p. 2), so the square of the phasor `a_i` is
read as its squared modulus `|a_i|^2`. -/
def selfTerm (t : Matrix (Fin M) (Fin N) ℂ) (E : Fin N → ℂ) (m : Fin M) (seg : Fin N → Fin k)
    (p : Fin k) : ℝ :=
  ∑ i ∈ Finset.univ.filter (fun i => seg i = p), Complex.normSq (amp t E m i)

/-- Section 2, eq. (3), PDF p. 3, second term of each bracket:
`∑_{i ∈ Q_p} ∑_{j ∈ Q_p, j ≠ i} t_{mi} E_i^in · t_{mj} E_j^in`, the interference between distinct
modes inside segment `Q_p`. The product `a_i · a_j` of two phasors is read as their inner product
in `ℝ^2`, `Re (a_i * conj a_j)`. -/
def intraTerm (t : Matrix (Fin M) (Fin N) ℂ) (E : Fin N → ℂ) (m : Fin M) (seg : Fin N → Fin k)
    (p : Fin k) : ℝ :=
  ∑ i ∈ Finset.univ.filter (fun i => seg i = p),
    ∑ j ∈ Finset.univ.filter (fun j => seg j = p ∧ j ≠ i),
      (amp t E m i * (starRingEnd ℂ) (amp t E m j)).re

/-- Section 2, eq. (3), PDF p. 3, remaining terms of each bracket:
`∑_{i ∈ Q_p} ∑_{j ∈ Q_q} t_{mi} E_i^in · t_{mj} E_j^in`, the interference between the modes of
segment `Q_p` and those of segment `Q_q`, with `a_i · a_j` the phasor inner product
`Re (a_i * conj a_j)`. -/
def crossTerm (t : Matrix (Fin M) (Fin N) ℂ) (E : Fin N → ℂ) (m : Fin M) (seg : Fin N → Fin k)
    (p q : Fin k) : ℝ :=
  ∑ i ∈ Finset.univ.filter (fun i => seg i = p),
    ∑ j ∈ Finset.univ.filter (fun j => seg j = q),
      (amp t E m i * (starRingEnd ℂ) (amp t E m j)).re

/-- Section 2, eq. (3.p), PDF p. 3: the square bracket of segment `Q_p`, i.e. the self terms of
`Q_p`, the interference inside `Q_p`, and the interference of `Q_p` with every other segment
`Q_q`, `q ≠ p`. -/
def segBracket (t : Matrix (Fin M) (Fin N) ℂ) (E : Fin N → ℂ) (m : Fin M) (seg : Fin N → Fin k)
    (p : Fin k) : ℝ :=
  selfTerm t E m seg p + intraTerm t E m seg p +
    ∑ q ∈ Finset.univ.filter (fun q => q ≠ p), crossTerm t E m seg p q

end Arxiv2011_11825
Source
Guo, Zhang, Li and Pang, Sequential Transmission Matrix Evaluation Via Spatiotemporal Transmitted Modes Decomposition, arXiv:2011.11825v1 (2020), Section 2, eqs. (1)-(3), PDF pp. 2-3; Supplement S1, eq. (S1), PDF p. 16
Read-back

What the Lean code literally says, in plain math · claude-opus-5-5

Setting. Throughout, MMM, NNN, kkk are arbitrary natural numbers, and any of them may be 000. Output modes are indexed by m∈{0,…,M−1}m \in \{0,\dots,M-1\}m∈{0,…,M−1} and input modes by i∈{0,…,N−1}i \in \{0,\dots,N-1\}i∈{0,…,N−1}. The transmission matrix ttt is an arbitrary M×NM \times NM×N matrix with complex entries tm,it_{m,i}tm,i​. The input field EEE is an arbitrary function assigning a complex number EiE_iEi​ to each input mode. The segment map seg\mathrm{seg}seg is an arbitrary function from input modes to segment labels {0,…,k−1}\{0,\dots,k-1\}{0,…,k−1}.

For a label ppp, write

Qp={ i:seg(i)=p }.Q_p = \{\, i : \mathrm{seg}(i) = p \,\}.Qp​={i:seg(i)=p}.

No condition is placed on seg\mathrm{seg}seg. A segment QpQ_pQp​ may be empty, and nothing forces the segments to be nonempty or of any particular size. The sets QpQ_pQp​ are automatically pairwise disjoint and cover all input modes, since seg\mathrm{seg}seg is a function. If k=0k = 0k=0, such a map exists only when N=0N = 0N=0, and then no label ppp exists at all.

Output field Emout(t,E)E^{\mathrm{out}}_m(t,E)Emout​(t,E). For an output mode mmm, this is the complex number

Emout=∑i=0N−1tm,i Ei.E^{\mathrm{out}}_m = \sum_{i=0}^{N-1} t_{m,i}\, E_i .Emout​=i=0∑N−1​tm,i​Ei​.

When N=0N = 0N=0 the sum is empty and the value is 000.

Amplitude am,i(t,E)a_{m,i}(t,E)am,i​(t,E). For an output mode mmm and an input mode iii, this is the complex number

am,i=tm,i Ei,a_{m,i} = t_{m,i}\, E_i ,am,i​=tm,i​Ei​,

the plain product of the matrix entry and the input value. Its modulus is not taken.

Output intensity Imout(t,E)I^{\mathrm{out}}_m(t,E)Imout​(t,E). This is the real number

Imout=∣Emout∣2=∣∑i=0N−1tm,iEi∣2,I^{\mathrm{out}}_m = \bigl|E^{\mathrm{out}}_m\bigr|^2 = \Bigl|\sum_{i=0}^{N-1} t_{m,i} E_i\Bigr|^2 ,Imout​=​Emout​​2=​i=0∑N−1​tm,i​Ei​​2,

the squared complex modulus of the output field. It equals 000 when N=0N = 0N=0.

Self term Sm,p(t,E,seg)S_{m,p}(t,E,\mathrm{seg})Sm,p​(t,E,seg). For an output mode mmm and a segment label ppp, this is the real number

Sm,p=∑i∈Qp∣am,i∣2=∑i∈Qp∣tm,iEi∣2.S_{m,p} = \sum_{i \in Q_p} \bigl|a_{m,i}\bigr|^2 = \sum_{i \in Q_p} \bigl|t_{m,i}E_i\bigr|^2 .Sm,p​=i∈Qp​∑​​am,i​​2=i∈Qp​∑​​tm,i​Ei​​2.

This is a sum of squared moduli, not of complex squares am,i2a_{m,i}^2am,i2​. It equals 000 when QpQ_pQp​ is empty.

Intra-segment term Rm,p(t,E,seg)R_{m,p}(t,E,\mathrm{seg})Rm,p​(t,E,seg). This is the real number

Rm,p=∑i∈Qp  ∑j∈Qpj≠iRe⁡ ⁣(am,i am,j‾).R_{m,p} = \sum_{i \in Q_p} \;\sum_{\substack{j \in Q_p \\ j \ne i}} \operatorname{Re}\!\bigl(a_{m,i}\,\overline{a_{m,j}}\bigr).Rm,p​=i∈Qp​∑​j∈Qp​j=i​∑​Re(am,i​am,j​​).

Here  ⋅ ‾\overline{\,\cdot\,}⋅ is complex conjugation and Re⁡\operatorname{Re}Re is the real part. The sum runs over ordered pairs (i,j)(i,j)(i,j) of distinct modes in QpQ_pQp​, so each unordered pair {i,j}\{i,j\}{i,j} contributes twice, once as (i,j)(i,j)(i,j) and once as (j,i)(j,i)(j,i). The sum is 000 when QpQ_pQp​ has fewer than two elements.

Cross term Cm,p,q(t,E,seg)C_{m,p,q}(t,E,\mathrm{seg})Cm,p,q​(t,E,seg). For two segment labels ppp and qqq, this is the real number

Cm,p,q=∑i∈Qp  ∑j∈QqRe⁡ ⁣(am,i am,j‾).C_{m,p,q} = \sum_{i \in Q_p} \;\sum_{j \in Q_q} \operatorname{Re}\!\bigl(a_{m,i}\,\overline{a_{m,j}}\bigr).Cm,p,q​=i∈Qp​∑​j∈Qq​∑​Re(am,i​am,j​​).

The sum runs over all ordered pairs with i∈Qpi \in Q_pi∈Qp​ and j∈Qqj \in Q_qj∈Qq​. The definition does not require p≠qp \ne qp=q. If p=qp = qp=q, the diagonal pairs i=ji = ji=j are included and contribute ∣am,i∣2|a_{m,i}|^2∣am,i​∣2. The value is 000 if either segment is empty.

Segment bracket Bm,p(t,E,seg)B_{m,p}(t,E,\mathrm{seg})Bm,p​(t,E,seg). For an output mode mmm and a segment label ppp, this is the real number

Bm,p=Sm,p+Rm,p+∑q=0q≠pk−1Cm,p,q.B_{m,p} = S_{m,p} + R_{m,p} + \sum_{\substack{q = 0 \\ q \ne p}}^{k-1} C_{m,p,q}.Bm,p​=Sm,p​+Rm,p​+q=0q=p​∑k−1​Cm,p,q​.

Written out in full, it is

Bm,p=∑i∈Qp∣tm,iEi∣2  +  ∑i∈Qp∑j∈Qpj≠iRe⁡ ⁣(tm,iEi tm,jEj‾)  +  ∑q≠p  ∑i∈Qp∑j∈QqRe⁡ ⁣(tm,iEi tm,jEj‾).B_{m,p} = \sum_{i \in Q_p} |t_{m,i}E_i|^2 \;+\; \sum_{i \in Q_p}\sum_{\substack{j \in Q_p\\ j\ne i}} \operatorname{Re}\!\bigl(t_{m,i}E_i\,\overline{t_{m,j}E_j}\bigr) \;+\; \sum_{q \ne p}\;\sum_{i \in Q_p}\sum_{j \in Q_q} \operatorname{Re}\!\bigl(t_{m,i}E_i\,\overline{t_{m,j}E_j}\bigr).Bm,p​=i∈Qp​∑​∣tm,i​Ei​∣2+i∈Qp​∑​j∈Qp​j=i​∑​Re(tm,i​Ei​tm,j​Ej​​)+q=p∑​i∈Qp​∑​j∈Qq​∑​Re(tm,i​Ei​tm,j​Ej​​).

Only cross terms with ppp as the first index appear, ranging over every other label qqq, including labels whose segment is empty. If QpQ_pQp​ is empty, then Bm,p=0B_{m,p} = 0Bm,p​=0. These definitions only assign values. No relation between Bm,pB_{m,p}Bm,p​ and ImoutI^{\mathrm{out}}_mImout​, such as a sum over ppp, is stated.

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

    Confirmed by the moderator at approval.

  • Endorsed by Xeroth · Nov 25, 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