Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Wirtinger flow: phaseless measurements, objective and Wirtinger gradient, spectral initialization, phase distance, Gaussian and coded diffraction models, Hessian, regularity condition

Definition
WirtingerFlow_Basic

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

gradient-descentnonconvex-optimizationphase-retrievalrandom-matricesspectral-initialization

Objects of Sections 2-7 of Candès, Li and Soltanolkotabi (2015).

  1. Signals and samples (eq. 1.1). Signals x,z∈Cnx,z\in\mathbb{C}^nx,z∈Cn carry the Euclidean norm and the inner product ⟨u,v⟩=u∗v\langle u,v\rangle=u^*v⟨u,v⟩=u∗v. Given sampling vectors ar∈Cna_r\in\mathbb{C}^nar​∈Cn, indexed by a finite set of size mmm, the phaseless samples are yr=∣ar∗x∣2y_r=|a_r^*x|^2yr​=∣ar∗​x∣2.
  2. Objective and Wirtinger gradient (eqs. 2.1, 2.2; Section 7.2). The objective is f(z)=12m∑r(yr−∣ar∗z∣2)2f(z)=\frac1{2m}\sum_r(y_r-|a_r^*z|^2)^2f(z)=2m1​∑r​(yr​−∣ar∗​z∣2)2, and its Wirtinger gradient is
∇f(z)=1m∑r=1m(∣ar∗z∣2−yr) arar∗z.\nabla f(z)=\frac1m\sum_{r=1}^m\big(|a_r^*z|^2-y_r\big)\,a_ra_r^*z.∇f(z)=m1​r=1∑m​(∣ar∗​z∣2−yr​)ar​ar∗​z.
  1. Distance (Definition 3.2). dist⁡(z,x)=min⁡φ∈[0,2π]∥z−eiφx∥\operatorname{dist}(z,x)=\min_{\varphi\in[0,2\pi]}\|z-e^{i\varphi}x\|dist(z,x)=minφ∈[0,2π]​∥z−eiφx∥. A minimising phase is written φ(z)\varphi(z)φ(z).
  2. Iterations. The gradient iteration of Lemma 7.10 is zτ+1=zτ−μ∇f(zτ)z_{\tau+1}=z_\tau-\mu\nabla f(z_\tau)zτ+1​=zτ​−μ∇f(zτ​). The Wirtinger flow with constant learning parameter μ\muμ (eq. 2.2) is zτ+1=zτ−μ∥z0∥2∇f(zτ)z_{\tau+1}=z_\tau-\frac{\mu}{\|z_0\|^2}\nabla f(z_\tau)zτ+1​=zτ​−∥z0​∥2μ​∇f(zτ​).
  3. Spectral initialization (Algorithm 1, Theorem 3.3). Y=1m∑ryrarar∗Y=\frac1m\sum_ry_ra_ra_r^*Y=m1​∑r​yr​ar​ar∗​. An initial estimate is z0=m−1∑ryr  vz_0=\sqrt{m^{-1}\sum_ry_r}\;vz0​=m−1∑r​yr​​v, where vvv is a unit eigenvector of YYY for its largest eigenvalue.
  4. Regularity condition (Condition 7.9). RC(α,β,ε)\mathrm{RC}(\alpha,\beta,\varepsilon)RC(α,β,ε) holds if, for every zzz with dist⁡(z,x)≤ε\operatorname{dist}(z,x)\le\varepsilondist(z,x)≤ε and every minimising phase φ(z)\varphi(z)φ(z),
Re⁡⟨∇f(z),z−xeiφ(z)⟩≥1αdist⁡2(z,x)+1β∥∇f(z)∥2,\operatorname{Re}\langle\nabla f(z),z-xe^{i\varphi(z)}\rangle\ge\tfrac1\alpha\operatorname{dist}^2(z,x)+\tfrac1\beta\|\nabla f(z)\|^2,Re⟨∇f(z),z−xeiφ(z)⟩≥α1​dist2(z,x)+β1​∥∇f(z)∥2,

where fff uses the data y=∣Ax∣2y=|Ax|^2y=∣Ax∣2. 7. Hessian (Sections 6, 7.2). In conjugate coordinates,

∇2f(z)=1m∑r[(2∣ar∗z∣2−yr)arar∗(ar∗z)2ararT(ar∗z)‾2aˉrar∗(2∣ar∗z∣2−yr)aˉrarT]∈C2n×2n.\nabla^2f(z)=\frac1m\sum_r\begin{bmatrix}(2|a_r^*z|^2-y_r)a_ra_r^*&(a_r^*z)^2a_ra_r^T\\\overline{(a_r^*z)}^2\bar a_ra_r^*&(2|a_r^*z|^2-y_r)\bar a_ra_r^T\end{bmatrix}\in\mathbb{C}^{2n\times2n}.∇2f(z)=m1​r∑​[(2∣ar∗​z∣2−yr​)ar​ar∗​(ar∗​z)​2aˉr​ar∗​​(ar∗​z)2ar​arT​(2∣ar∗​z∣2−yr​)aˉr​arT​​]∈C2n×2n.

The matrix of Lemma 7.1 is I2n+32[xxˉ][x∗,xT]−12[x−xˉ][x∗,−xT]I_{2n}+\frac32\begin{bmatrix}x\\\bar x\end{bmatrix}[x^*,x^T]-\frac12\begin{bmatrix}x\\-\bar x\end{bmatrix}[x^*,-x^T]I2n​+23​[xxˉ​][x∗,xT]−21​[x−xˉ​][x∗,−xT]. The stacked vector [hhˉ]\begin{bmatrix}h\\\bar h\end{bmatrix}[hhˉ​] is written [h;hˉ][h;\bar h][h;hˉ]. ∥M∥\|M\|∥M∥ is the operator norm, and m−1∑rarar∗m^{-1}\sum_ra_ra_r^*m−1∑r​ar​ar∗​ is the sample covariance. 8. Gaussian model (Definition 3.1). The vectors a1,…,ama_1,\dots,a_ma1​,…,am​ are i.i.d., and each has i.i.d. coordinates with law N(0,12)+i N(0,12)\mathcal N(0,\frac12)+i\,\mathcal N(0,\frac12)N(0,21​)+iN(0,21​) (independent real and imaginary parts). 9. Coded diffraction model (Section 4.1, eqs. 4.1-4.2). A law ν\nuν of a complex random variable ddd is admissible with bound MMM if ddd is symmetric, ∣d∣≤M|d|\le M∣d∣≤M, Ed=0\mathbb E d=0Ed=0, Ed2=0\mathbb E d^2=0Ed2=0 and E∣d∣4=2(E∣d∣2)2\mathbb E|d|^4=2(\mathbb E|d|^2)^2E∣d∣4=2(E∣d∣2)2. The patterns d1,…,dL∈Cnd_1,\dots,d_L\in\mathbb{C}^nd1​,…,dL​∈Cn are i.i.d. with i.i.d. entries of law ν\nuν. The sampling vectors are a(ℓ,k)(t)=dℓ(t)ei2πkt/na_{(\ell,k)}(t)=d_\ell(t)e^{i2\pi kt/n}a(ℓ,k)​(t)=dℓ​(t)ei2πkt/n for 1≤ℓ≤L1\le\ell\le L1≤ℓ≤L and 0≤k,t≤n−10\le k,t\le n-10≤k,t≤n−1, so m=nLm=nLm=nL and y(ℓ,k)=∣∑tx[t]dˉℓ(t)e−i2πkt/n∣2y_{(\ell,k)}=\big|\sum_tx[t]\bar d_\ell(t)e^{-i2\pi kt/n}\big|^2y(ℓ,k)​=​∑t​x[t]dˉℓ​(t)e−i2πkt/n​2.

Formalization Note The minimum in Definition 3.2 is written as an infimum over the compact interval [0,2π][0,2\pi][0,2π], where it is attained. Since φ(z)\varphi(z)φ(z) need not be unique (the phase eiφ(z)e^{i\varphi(z)}eiφ(z) is unique once dist⁡(z,x)<∥x∥\operatorname{dist}(z,x)<\|x\|dist(z,x)<∥x∥, but on [0,2π][0,2\pi][0,2π] the endpoints 000 and 2π2\pi2π give the same phase, so φ\varphiφ itself is unique only modulo 2π2\pi2π), RC\mathrm{RC}RC is required for every minimising phase. The leading eigenvector is characterised by comparison with every real eigenvalue, which is enough because YYY is Hermitian. A sample of either model is the array of coordinates of the random vectors, and its law is a finite product measure.

Definition code
import Mathlib

/-!
Candès, Li and Soltanolkotabi, *Phase Retrieval via Wirtinger Flow: Theory and Algorithms*,
arXiv:1407.1065v3 (2015): the phaseless measurements of eq. (1.1), the objective and Wirtinger
gradient of eqs. (2.1)-(2.2) and Section 7.2, the spectral initialization of Algorithm 1, the
distance of Definition 3.2, the Gaussian model of Definition 3.1, the admissible coded diffraction
model of Section 4.1 (eqs. (4.1)-(4.2)), the complex Hessian of Sections 6 and 7.2 with its
expectation from Lemma 7.1, and the regularity condition of Condition 7.9.
-/

open MeasureTheory ProbabilityTheory Complex

noncomputable section

namespace WirtingerFlow

/-- Signals and sampling vectors live in `ℂⁿ` with its Euclidean norm and the inner product
`⟨u, v⟩ = u^* v` (conjugate-linear in the first argument), as throughout the paper. -/
abbrev Sig (n : ℕ) := EuclideanSpace ℂ (Fin n)

/-- A coordinate vector `(v(0), …, v(n-1))` viewed as an element of `ℂⁿ`. -/
def toSig {n : ℕ} (v : Fin n → ℂ) : Sig n := WithLp.toLp 2 v

variable {R : Type*} [Fintype R] {n : ℕ}

/-- Eq. (1.1): the phaseless samples `y_r = |⟨a_r, x⟩|² = |a_r^* x|²`, indexed by a finite set of
`m = |R|` sampling vectors `a_r`. -/
def meas (a : R → Sig n) (x : Sig n) (r : R) : ℝ := ‖inner ℂ (a r) x‖ ^ 2

/-- Eq. (2.1) with the quadratic loss `ℓ(x, y) = (x - y)²`:
`f(z) = (1/2m) ∑_r (y_r - |a_r^* z|²)²`. -/
def loss (a : R → Sig n) (y : R → ℝ) (z : Sig n) : ℝ :=
  1 / (2 * (Fintype.card R : ℝ)) * ∑ r, (y r - ‖inner ℂ (a r) z‖ ^ 2) ^ 2

/-- Eq. (2.2) and Section 7.2: the Wirtinger gradient
`∇f(z) = (1/m) ∑_r (|a_r^* z|² - y_r) (a_r a_r^*) z`. -/
def grad (a : R → Sig n) (y : R → ℝ) (z : Sig n) : Sig n :=
  ((1 / (Fintype.card R : ℝ) : ℝ) : ℂ) •
    ∑ r, ((((‖inner ℂ (a r) z‖ ^ 2 - y r : ℝ)) : ℂ) * inner ℂ (a r) z) • a r

/-- Definition 3.2: `dist(z, x) = min_{φ ∈ [0, 2π]} ‖z - e^{iφ} x‖` (the minimum is attained, so it
is written as an infimum over the compact interval). -/
def phaseDist (z x : Sig n) : ℝ :=
  sInf ((fun φ : ℝ => ‖z - Complex.exp ((φ : ℂ) * I) • x‖) '' Set.Icc 0 (2 * Real.pi))

/-- Section 7.1: `φ` is a phase `φ(z) ∈ [0, 2π]` attaining `dist(z, x) = ‖z - e^{iφ(z)} x‖`. -/
def IsMinPhase (z x : Sig n) (φ : ℝ) : Prop :=
  φ ∈ Set.Icc 0 (2 * Real.pi) ∧ ‖z - Complex.exp ((φ : ℂ) * I) • x‖ = phaseDist z x

/-- Lemma 7.10: the gradient iteration `z_{τ+1} = z_τ - μ ∇f(z_τ)` started at `z_0`. -/
def gdSeq (a : R → Sig n) (y : R → ℝ) (μ : ℝ) (z0 : Sig n) : ℕ → Sig n
  | 0 => z0
  | τ + 1 => gdSeq a y μ z0 τ - (μ : ℂ) • grad a y (gdSeq a y μ z0 τ)

/-- Eq. (2.2) with a constant learning parameter `μ_τ = μ`:
the Wirtinger flow iterates `z_{τ+1} = z_τ - (μ / ‖z_0‖²) ∇f(z_τ)`. -/
def wfSeq (a : R → Sig n) (y : R → ℝ) (μ : ℝ) (z0 : Sig n) : ℕ → Sig n :=
  gdSeq a y (μ / ‖z0‖ ^ 2) z0

/-- Algorithm 1: the matrix `Y = (1/m) ∑_r y_r a_r a_r^*`, acting on `v` as
`Y v = (1/m) ∑_r y_r (a_r^* v) a_r`. -/
def specOp (a : R → Sig n) (y : R → ℝ) (v : Sig n) : Sig n :=
  ((1 / (Fintype.card R : ℝ) : ℝ) : ℂ) • ∑ r, ((y r : ℂ) * inner ℂ (a r) v) • a r

/-- Algorithm 1: `v` is an eigenvector of `Y` for its largest eigenvalue. Since `Y` is Hermitian
when `y` is real, every eigenvalue is real, so the comparison ranges over real eigenvalues. -/
def IsLeadingEigvec (Y : Sig n → Sig n) (v : Sig n) : Prop :=
  v ≠ 0 ∧ ∃ c : ℝ, Y v = (c : ℂ) • v ∧
    ∀ (c' : ℝ) (w : Sig n), w ≠ 0 → Y w = (c' : ℂ) • w → c' ≤ c

/-- Theorem 3.3: the Wirtinger flow initial estimates, i.e. every leading eigenvector of `Y` of unit
norm rescaled to squared Euclidean norm `m^{-1} ∑_r y_r`. -/
def initSet (a : R → Sig n) (y : R → ℝ) : Set (Sig n) :=
  {z | ∃ v : Sig n, IsLeadingEigvec (specOp a y) v ∧ ‖v‖ = 1 ∧
    z = ((Real.sqrt ((∑ r, y r) / (Fintype.card R : ℝ)) : ℝ) : ℂ) • v}

/-- Condition 7.9, `RC(α, β, ε)` for the objective `f` with data `y = |A x|²`: for every `z` with
`dist(z, x) ≤ ε` and every phase `φ(z)` attaining `dist(z, x)`,
`Re ⟨∇f(z), z - x e^{iφ(z)}⟩ ≥ (1/α) dist²(z, x) + (1/β) ‖∇f(z)‖²`. -/
def RegCond (a : R → Sig n) (x : Sig n) (α β ε : ℝ) : Prop :=
  ∀ z : Sig n, phaseDist z x ≤ ε → ∀ φ : ℝ, IsMinPhase z x φ →
    1 / α * phaseDist z x ^ 2 + 1 / β * ‖grad a (meas a x) z‖ ^ 2 ≤
      (inner ℂ (grad a (meas a x) z) (z - Complex.exp ((φ : ℂ) * I) • x)).re

/-- Sections 6 and 7.2: the complex Hessian of `f` in conjugate coordinates,
`∇²f(z) = (1/m) ∑_r [[(2|a_r^* z|² - y_r) a_r a_r^*, (a_r^* z)² a_r a_r^T],
[(conj(a_r^* z))² ā_r a_r^*, (2|a_r^* z|² - y_r) ā_r a_r^T]]`, a `2n × 2n` matrix. -/
def hess (a : R → Sig n) (y : R → ℝ) (z : Sig n) : Matrix (Fin n ⊕ Fin n) (Fin n ⊕ Fin n) ℂ :=
  ((1 / (Fintype.card R : ℝ) : ℝ) : ℂ) • ∑ r, Matrix.fromBlocks
    ((((2 * ‖inner ℂ (a r) z‖ ^ 2 - y r : ℝ)) : ℂ) •
      Matrix.vecMulVec (WithLp.ofLp (a r)) (star (WithLp.ofLp (a r))))
    ((inner ℂ (a r) z) ^ 2 • Matrix.vecMulVec (WithLp.ofLp (a r)) (WithLp.ofLp (a r)))
    ((starRingEnd ℂ (inner ℂ (a r) z)) ^ 2 •
      Matrix.vecMulVec (star (WithLp.ofLp (a r))) (star (WithLp.ofLp (a r))))
    ((((2 * ‖inner ℂ (a r) z‖ ^ 2 - y r : ℝ)) : ℂ) •
      Matrix.vecMulVec (star (WithLp.ofLp (a r))) (WithLp.ofLp (a r)))

/-- Section 6: the conjugate-coordinate vector `[h; h̄] ∈ ℂ^{2n}`. -/
def stack (h : Sig n) : Fin n ⊕ Fin n → ℂ :=
  Sum.elim (WithLp.ofLp h) (star (WithLp.ofLp h))

/-- Lemma 7.1: the matrix
`I_{2n} + (3/2) [x; x̄][x^*, x^T] - (1/2) [x; -x̄][x^*, -x^T]`. -/
def expHess (x : Sig n) : Matrix (Fin n ⊕ Fin n) (Fin n ⊕ Fin n) ℂ :=
  1 + (3 / 2 : ℂ) • Matrix.vecMulVec (stack x) (star (stack x)) -
    (1 / 2 : ℂ) • Matrix.vecMulVec (Sum.elim (WithLp.ofLp x) (-star (WithLp.ofLp x)))
      (star (Sum.elim (WithLp.ofLp x) (-star (WithLp.ofLp x))))

/-- Lemma 7.8: the sample covariance matrix `m^{-1} ∑_r a_r a_r^*`. -/
def covMat (a : R → Sig n) : Matrix (Fin n) (Fin n) ℂ :=
  ((1 / (Fintype.card R : ℝ) : ℝ) : ℂ) •
    ∑ r, Matrix.vecMulVec (WithLp.ofLp (a r)) (star (WithLp.ofLp (a r)))

/-- The operator (spectral) norm `‖M‖` of a complex square matrix acting on Euclidean space, used
in Lemmas 7.4 and 7.8. -/
def opNorm {ι : Type*} [Fintype ι] [DecidableEq ι] (M : Matrix ι ι ℂ) : ℝ :=
  ‖Matrix.toEuclideanCLM (𝕜 := ℂ) M‖

/-- Definition 3.1: the standard complex Gaussian `N(0, 1/2) + i N(0, 1/2)` on `ℂ`. -/
def stdCGauss : Measure ℂ :=
  ((gaussianReal 0 (1 / 2 : NNReal)).prod (gaussianReal 0 (1 / 2 : NNReal))).map
    fun p : ℝ × ℝ => (p.1 : ℂ) + (p.2 : ℂ) * I

/-- Definition 3.1: a sampling vector `a ∼ N(0, I/2) + i N(0, I/2)` in `ℂⁿ`, in coordinates. -/
def cnGauss (n : ℕ) : Measure (Fin n → ℂ) :=
  Measure.pi fun _ : Fin n => stdCGauss

/-- Definition 3.1: the Gaussian model, `m` i.i.d. sampling vectors `a_1, …, a_m`; the sample is the
`m × n` array of their coordinates. -/
def gaussModel (m n : ℕ) : Measure (Fin m → Fin n → ℂ) :=
  Measure.pi fun _ : Fin m => cnGauss n

/-- The sampling vectors `a_r ∈ ℂⁿ`, `r = 1, …, m`, read off a sample of the Gaussian model. -/
def rows {m : ℕ} (A : Fin m → Fin n → ℂ) : Fin m → Sig n :=
  fun r => toSig (A r)

/-- Section 4.1, eq. (4.2): `ν`, the law of a complex random variable `d`, is admissible with bound
`M`: `d` is symmetric (`-d` has the law of `d`), `|d| ≤ M`, `E d = 0`, `E d² = 0` and
`E|d|⁴ = 2 (E|d|²)²`. -/
def IsAdmissible (ν : Measure ℂ) (M : ℝ) : Prop :=
  IsProbabilityMeasure ν ∧ ν.map (fun d : ℂ => -d) = ν ∧ (∀ᵐ d ∂ν, ‖d‖ ≤ M) ∧
    ∫ d, d ∂ν = 0 ∧ ∫ d, d ^ 2 ∂ν = 0 ∧ ∫ d, ‖d‖ ^ 4 ∂ν = 2 * (∫ d, ‖d‖ ^ 2 ∂ν) ^ 2

/-- Section 4.1: `L` i.i.d. modulation patterns `d_ℓ = (d_ℓ(0), …, d_ℓ(n-1))` with i.i.d. entries
of law `ν`. -/
def cdpModel (ν : Measure ℂ) (L n : ℕ) : Measure (Fin L → Fin n → ℂ) :=
  Measure.pi fun _ : Fin L => Measure.pi fun _ : Fin n => ν

/-- Eq. (4.1) and Appendix A: the coded diffraction sampling vectors `a_r = D_ℓ f_k`,
`r = (ℓ, k)`, with entries `a_r(t) = d_ℓ(t) e^{i 2π k t / n}`, so that
`y_r = |∑_t x[t] d̄_ℓ(t) e^{-i 2π k t / n}|² = |a_r^* x|²`. -/
def cdpVecs {L : ℕ} (d : Fin L → Fin n → ℂ) : Fin L × Fin n → Sig n :=
  fun r => toSig fun t =>
    d r.1 t * Complex.exp (2 * Real.pi * I * (r.2 : ℂ) * (t : ℂ) / (n : ℂ))

end WirtingerFlow
Source
Candès, Li and Soltanolkotabi, Phase Retrieval via Wirtinger Flow: Theory and Algorithms, arXiv:1407.1065v3 (2015), Sections 1-2 (eqs. (1.1), (2.1), (2.2), Algorithm 1), Section 3.1 (Definitions 3.1-3.2), Section 4.1 (eqs. (4.1)-(4.2)), Section 6, Sections 7.1-7.4 (Lemma 7.1, Condition 7.9)
Read-back

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

Signal space (Sign\mathrm{Sig}_nSign​). For a natural number nnn (possibly n=0n = 0n=0, in which case the space is the zero space), Sign\mathrm{Sig}_nSign​ is Cn\mathbb{C}^nCn, with coordinates indexed by t=0,…,n−1t = 0, \dots, n-1t=0,…,n−1. It carries the Euclidean norm ∥v∥=(∑t∣vt∣2)1/2\|v\| = \big(\sum_t |v_t|^2\big)^{1/2}∥v∥=(∑t​∣vt​∣2)1/2 and the inner product

⟨u,v⟩=∑t=0n−1ut‾ vt=u∗v,\langle u, v\rangle = \sum_{t=0}^{n-1} \overline{u_t}\, v_t = u^* v,⟨u,v⟩=t=0∑n−1​ut​​vt​=u∗v,

which is conjugate-linear in the first argument and linear in the second. Throughout, a∗xa^* xa∗x denotes ⟨a,x⟩\langle a, x\rangle⟨a,x⟩ in this sense.

Coordinate embedding (toSig\mathrm{toSig}toSig). Given any function v:{0,…,n−1}→Cv : \{0,\dots,n-1\} \to \mathbb{C}v:{0,…,n−1}→C, toSig(v)\mathrm{toSig}(v)toSig(v) is the same tuple (v(0),…,v(n−1))(v(0), \dots, v(n-1))(v(0),…,v(n−1)) regarded as an element of Cn\mathbb{C}^nCn with the Euclidean structure above. Nothing is changed or normalized.

Common setting for the next several definitions. RRR is an arbitrary finite index set and m=∣R∣m = |R|m=∣R∣ is its cardinality. RRR may be empty, so m=0m = 0m=0 is allowed. Whenever a formula below contains a factor 1/m1/m1/m or 1/(2m)1/(2m)1/(2m), the convention 1/0=01/0 = 01/0=0 applies when m=0m = 0m=0, so that factor (and hence the whole expression) is 000. The family a=(ar)r∈Ra = (a_r)_{r\in R}a=(ar​)r∈R​ consists of arbitrary vectors in Cn\mathbb{C}^nCn, and y=(yr)r∈Ry = (y_r)_{r \in R}y=(yr​)r∈R​ consists of arbitrary real numbers. In particular, yyy is not required to be nonnegative, nor to arise from any signal unless stated.

Measurements (meas\mathrm{meas}meas). For sampling vectors a=(ar)r∈Ra = (a_r)_{r\in R}a=(ar​)r∈R​ in Cn\mathbb{C}^nCn, a signal x∈Cnx \in \mathbb{C}^nx∈Cn and an index r∈Rr \in Rr∈R, the measurement is the real number

meas(a,x)r=∣⟨ar,x⟩∣2=∣ar∗x∣2.\mathrm{meas}(a, x)_r = |\langle a_r, x\rangle|^2 = |a_r^* x|^2 .meas(a,x)r​=∣⟨ar​,x⟩∣2=∣ar∗​x∣2.

Objective (f=lossf = \mathrm{loss}f=loss). For aaa and yyy as in the common setting and z∈Cnz \in \mathbb{C}^nz∈Cn, the objective is

fa,y(z)=12m∑r∈R(yr−∣ar∗z∣2)2.f_{a,y}(z) = \frac{1}{2m} \sum_{r \in R} \big(y_r - |a_r^* z|^2\big)^2 .fa,y​(z)=2m1​r∈R∑​(yr​−∣ar∗​z∣2)2.

When m=0m = 0m=0, this equals 000 for every zzz.

Gradient (∇f=grad\nabla f = \mathrm{grad}∇f=grad). For aaa, yyy and z∈Cnz \in \mathbb{C}^nz∈Cn, the vector ∇fa,y(z)∈Cn\nabla f_{a,y}(z) \in \mathbb{C}^n∇fa,y​(z)∈Cn is

∇fa,y(z)=1m∑r∈R(∣ar∗z∣2−yr) (ar∗z) ar  =  1m∑r∈R(∣ar∗z∣2−yr) arar∗z.\nabla f_{a,y}(z) = \frac{1}{m} \sum_{r\in R} \big(|a_r^* z|^2 - y_r\big)\,(a_r^* z)\, a_r \;=\; \frac{1}{m}\sum_{r\in R} \big(|a_r^* z|^2 - y_r\big)\, a_r a_r^* z .∇fa,y​(z)=m1​r∈R∑​(∣ar∗​z∣2−yr​)(ar∗​z)ar​=m1​r∈R∑​(∣ar∗​z∣2−yr​)ar​ar∗​z.

When m=0m = 0m=0, this is the zero vector. This is a definition by explicit formula. No statement is made here about its relation to any derivative of fa,yf_{a,y}fa,y​.

Phase distance (dist\mathrm{dist}dist). For z,x∈Cnz, x \in \mathbb{C}^nz,x∈Cn, define

dist(z,x)=inf⁡{ ∥z−eiφx∥  :  φ∈[0,2π] }.\mathrm{dist}(z, x) = \inf\big\{\, \|z - e^{i\varphi} x\| \;:\; \varphi \in [0, 2\pi] \,\big\}.dist(z,x)=inf{∥z−eiφx∥:φ∈[0,2π]}.

This is the infimum of the values of a continuous function over the closed interval [0,2π][0, 2\pi][0,2π], so it is attained, and it is always ≥0\ge 0≥0. If x=0x = 0x=0, then dist(z,0)=∥z∥\mathrm{dist}(z, 0) = \|z\|dist(z,0)=∥z∥.

Minimizing phase (IsMinPhase\mathrm{IsMinPhase}IsMinPhase). For z,x∈Cnz, x \in \mathbb{C}^nz,x∈Cn and a real number φ\varphiφ, the property IsMinPhase(z,x,φ)\mathrm{IsMinPhase}(z, x, \varphi)IsMinPhase(z,x,φ) holds exactly when both of the following are true:

  • 0≤φ≤2π0 \le \varphi \le 2\pi0≤φ≤2π;
  • ∥z−eiφx∥=dist(z,x)\|z - e^{i\varphi} x\| = \mathrm{dist}(z, x)∥z−eiφx∥=dist(z,x).

Several phases may qualify. For example, if x=0x = 0x=0, every φ∈[0,2π]\varphi \in [0, 2\pi]φ∈[0,2π] does.

Gradient iteration (gdSeq\mathrm{gdSeq}gdSeq). Given aaa, yyy, a real step size μ\muμ (of any sign, including 000) and a starting point z0∈Cnz_0 \in \mathbb{C}^nz0​∈Cn, the sequence (zτ)τ∈N(z_\tau)_{\tau \in \mathbb{N}}(zτ​)τ∈N​ is defined recursively by

z0=z0,zτ+1=zτ−μ ∇fa,y(zτ),z_0 = z_0, \qquad z_{\tau+1} = z_\tau - \mu\, \nabla f_{a,y}(z_\tau),z0​=z0​,zτ+1​=zτ​−μ∇fa,y​(zτ​),

where ∇fa,y\nabla f_{a,y}∇fa,y​ is the gradient defined above. The step size is the same at every step.

Wirtinger flow iterates (wfSeq\mathrm{wfSeq}wfSeq). Given aaa, yyy, a real number μ\muμ and z0∈Cnz_0 \in \mathbb{C}^nz0​∈Cn, the Wirtinger flow sequence is the gradient iteration above with the constant step size μ/∥z0∥2\mu / \|z_0\|^2μ/∥z0​∥2:

zτ+1=zτ−μ∥z0∥2 ∇fa,y(zτ).z_{\tau+1} = z_\tau - \frac{\mu}{\|z_0\|^2}\, \nabla f_{a,y}(z_\tau).zτ+1​=zτ​−∥z0​∥2μ​∇fa,y​(zτ​).

If z0=0z_0 = 0z0​=0, the convention μ/0=0\mu/0 = 0μ/0=0 makes the step size 000, and the sequence is constantly 000.

Spectral operator (Y=specOpY = \mathrm{specOp}Y=specOp). For aaa and yyy, Ya,yY_{a,y}Ya,y​ is the map Cn→Cn\mathbb{C}^n \to \mathbb{C}^nCn→Cn given by

Ya,yv=1m∑r∈Ryr (ar∗v) ar  =  (1m∑r∈Ryr arar∗)v.Y_{a,y} v = \frac{1}{m} \sum_{r\in R} y_r\, (a_r^* v)\, a_r \;=\; \Big(\frac{1}{m}\sum_{r\in R} y_r\, a_r a_r^*\Big) v .Ya,y​v=m1​r∈R∑​yr​(ar∗​v)ar​=(m1​r∈R∑​yr​ar​ar∗​)v.

When m=0m = 0m=0, this is the zero map.

Leading eigenvector (IsLeadingEigvec\mathrm{IsLeadingEigvec}IsLeadingEigvec). Let Y:Cn→CnY : \mathbb{C}^n \to \mathbb{C}^nY:Cn→Cn be an arbitrary function; it is not assumed linear or Hermitian. A vector v∈Cnv \in \mathbb{C}^nv∈Cn is a leading eigenvector of YYY when all of the following hold:

  • v≠0v \neq 0v=0;
  • there is a real number ccc with Yv=c vYv = c\,vYv=cv;
  • for every real c′c'c′ and every nonzero w∈Cnw \in \mathbb{C}^nw∈Cn with Yw=c′ wYw = c'\,wYw=c′w, we have c′≤cc' \le cc′≤c.

Only real eigenvalues take part in the comparison. Non-real λ\lambdaλ with Yw=λwYw = \lambda wYw=λw are neither required nor compared. When n=0n = 0n=0, no vector satisfies this property.

Initial estimates (initSet\mathrm{initSet}initSet). For aaa and yyy, initSet(a,y)\mathrm{initSet}(a, y)initSet(a,y) is the set of all vectors

z=1m∑r∈Ryr   vz = \sqrt{\frac{1}{m}\sum_{r\in R} y_r}\;\, vz=m1​r∈R∑​yr​​v

where vvv ranges over all unit vectors (∥v∥=1\|v\| = 1∥v∥=1) that are leading eigenvectors (in the sense above) of the spectral operator Ya,yY_{a,y}Ya,y​. Here ⋅\sqrt{\cdot}⋅​ is the real square root, with the convention s=0\sqrt{s} = 0s​=0 for s<0s < 0s<0. This set contains every such rescaled eigenvector, including all unit-modulus phase multiples and all vectors in a multi-dimensional top eigenspace. Two degenerate cases:

  • When n=0n = 0n=0, the set is empty.
  • When m=0m = 0m=0, YYY is the zero map and the scale factor is 000, so the set is {0}\{0\}{0} (provided n≥1n \ge 1n≥1).

Regularity condition (RC\mathrm{RC}RC). Let a=(ar)r∈Ra = (a_r)_{r\in R}a=(ar​)r∈R​ be sampling vectors, x∈Cnx \in \mathbb{C}^nx∈Cn a signal, and α,β,ε\alpha, \beta, \varepsilonα,β,ε arbitrary real numbers (no sign or nonzero assumptions). Write ∇f\nabla f∇f for the gradient built with the data yr=∣ar∗x∣2y_r = |a_r^* x|^2yr​=∣ar∗​x∣2. Then RC(a,x,α,β,ε)\mathrm{RC}(a, x, \alpha, \beta, \varepsilon)RC(a,x,α,β,ε) means the following: for every z∈Cnz \in \mathbb{C}^nz∈Cn with dist(z,x)≤ε\mathrm{dist}(z, x) \le \varepsilondist(z,x)≤ε, and every φ\varphiφ satisfying IsMinPhase(z,x,φ)\mathrm{IsMinPhase}(z, x, \varphi)IsMinPhase(z,x,φ),

1α dist(z,x)2+1β ∥∇f(z)∥2  ≤  Re⁡ ⟨∇f(z), z−eiφx⟩,\frac{1}{\alpha}\,\mathrm{dist}(z, x)^2 + \frac{1}{\beta}\,\|\nabla f(z)\|^2 \;\le\; \operatorname{Re}\,\big\langle \nabla f(z),\, z - e^{i\varphi} x\big\rangle,α1​dist(z,x)2+β1​∥∇f(z)∥2≤Re⟨∇f(z),z−eiφx⟩,

where ⟨u,v⟩=u∗v\langle u, v\rangle = u^* v⟨u,v⟩=u∗v. Degenerate cases:

  • If α=0\alpha = 0α=0 (respectively β=0\beta = 0β=0), the corresponding coefficient 1/α1/\alpha1/α (respectively 1/β1/\beta1/β) is 000.
  • Negative α\alphaα or β\betaβ are permitted.
  • If ε<0\varepsilon < 0ε<0, no zzz qualifies, and the condition holds vacuously.

Complex Hessian (∇2f=hess\nabla^2 f = \mathrm{hess}∇2f=hess). For aaa, yyy and z∈Cnz \in \mathbb{C}^nz∈Cn, ∇2fa,y(z)\nabla^2 f_{a,y}(z)∇2fa,y​(z) is the 2n×2n2n \times 2n2n×2n complex matrix, with rows and columns indexed by two copies of {0,…,n−1}\{0,\dots,n-1\}{0,…,n−1} (first copy = top/left block), given by

∇2fa,y(z)=1m∑r∈R[(2∣ar∗z∣2−yr) arar∗(ar∗z)2 ararT(ar∗z‾)2 aˉrar∗(2∣ar∗z∣2−yr) aˉrarT].\nabla^2 f_{a,y}(z) = \frac{1}{m}\sum_{r\in R} \begin{bmatrix} \big(2|a_r^* z|^2 - y_r\big)\, a_r a_r^* & (a_r^* z)^2\, a_r a_r^{T} \\[4pt] \big(\overline{a_r^* z}\big)^2\, \bar a_r a_r^* & \big(2|a_r^* z|^2 - y_r\big)\, \bar a_r a_r^{T} \end{bmatrix}.∇2fa,y​(z)=m1​r∈R∑​[(2∣ar∗​z∣2−yr​)ar​ar∗​(ar∗​z​)2aˉr​ar∗​​(ar∗​z)2ar​arT​(2∣ar∗​z∣2−yr​)aˉr​arT​​].

Here aˉr\bar a_raˉr​ is the entrywise conjugate, arTa_r^{T}arT​ the plain transpose and ar∗=aˉrTa_r^* = \bar a_r^{T}ar∗​=aˉrT​. Thus ararTa_r a_r^Tar​arT​ has entries ar(i) ar(j)a_r(i)\,a_r(j)ar​(i)ar​(j), and aˉrar∗\bar a_r a_r^*aˉr​ar∗​ has entries ar(i)‾ ar(j)‾\overline{a_r(i)}\,\overline{a_r(j)}ar​(i)​ar​(j)​. When m=0m = 0m=0, this is the zero matrix.

Conjugate stacking (stack\mathrm{stack}stack). For h∈Cnh \in \mathbb{C}^nh∈Cn, stack(h)\mathrm{stack}(h)stack(h) is the vector

[hhˉ]∈C2n,\begin{bmatrix} h \\ \bar h\end{bmatrix} \in \mathbb{C}^{2n},[hhˉ​]∈C2n,

whose first block is hhh and whose second block is the entrywise conjugate hˉ\bar hhˉ.

Expected Hessian matrix (expHess\mathrm{expHess}expHess). For x∈Cnx \in \mathbb{C}^nx∈Cn, with no normalization assumed on xxx (any norm, including x=0x = 0x=0), expHess(x)\mathrm{expHess}(x)expHess(x) is the 2n×2n2n \times 2n2n×2n matrix

I2n+32[xxˉ][x∗xT]−12[x−xˉ][x∗−xT],I_{2n} + \frac{3}{2} \begin{bmatrix} x \\ \bar x\end{bmatrix}\begin{bmatrix} x^* & x^{T}\end{bmatrix} - \frac{1}{2}\begin{bmatrix} x \\ -\bar x\end{bmatrix}\begin{bmatrix} x^* & -x^{T}\end{bmatrix},I2n​+23​[xxˉ​][x∗​xT​]−21​[x−xˉ​][x∗​−xT​],

with the same block indexing as the Hessian. This is a definition of a specific matrix. No statement about any expectation is made here.

Sample covariance (covMat\mathrm{covMat}covMat). For aaa, covMat(a)\mathrm{covMat}(a)covMat(a) is the n×nn\times nn×n matrix

1m∑r∈Rarar∗.\frac{1}{m}\sum_{r\in R} a_r a_r^* .m1​r∈R∑​ar​ar∗​.

When m=0m = 0m=0, this is the zero matrix.

Operator norm (∥⋅∥op\|\cdot\|_{\mathrm{op}}∥⋅∥op​). For a complex square matrix MMM indexed by any finite set ι\iotaι, ∥M∥op\|M\|_{\mathrm{op}}∥M∥op​ is the operator norm of MMM acting on Cι\mathbb{C}^{\iota}Cι with the Euclidean norm:

∥M∥op=sup⁡∥v∥≤1∥Mv∥,\|M\|_{\mathrm{op}} = \sup_{\|v\| \le 1} \|Mv\|,∥M∥op​=∥v∥≤1sup​∥Mv∥,

which is the largest singular value of MMM.

Standard complex Gaussian (CN\mathcal{CN}CN). This is the probability measure on C\mathbb{C}C given by the law of U+iVU + iVU+iV, where UUU and VVV are independent real Gaussian random variables, each with mean 000 and variance 12\tfrac1221​. (Technically, it is the pushforward of the product measure N(0,12)⊗N(0,12)N(0,\tfrac12)\otimes N(0,\tfrac12)N(0,21​)⊗N(0,21​) under (u,v)↦u+iv(u,v)\mapsto u+iv(u,v)↦u+iv.)

Gaussian vector (cnGaussn\mathrm{cnGauss}_ncnGaussn​). This is the product measure on coordinate tuples (a(0),…,a(n−1))∈Cn(a(0), \dots, a(n-1)) \in \mathbb{C}^n(a(0),…,a(n−1))∈Cn under which the nnn coordinates are independent, each with the standard complex Gaussian law above. When n=0n = 0n=0, it is the unit mass on the single empty tuple.

Gaussian model (gaussModelm,n\mathrm{gaussModel}_{m,n}gaussModelm,n​). This is the product measure on m×nm \times nm×n complex arrays A=(Ar,t)A = (A_{r,t})A=(Ar,t​), with r<mr < mr<m and t<nt < nt<n, under which the mmm rows are independent, each distributed as the Gaussian vector above. Equivalently, all mnmnmn entries are independent standard complex Gaussians.

Rows of a sample (rows\mathrm{rows}rows). For an m×nm \times nm×n complex array AAA, rows(A)\mathrm{rows}(A)rows(A) is the family (ar)r=0m−1(a_r)_{r = 0}^{m-1}(ar​)r=0m−1​, where ar=(Ar,0,…,Ar,n−1)a_r = (A_{r,0}, \dots, A_{r,n-1})ar​=(Ar,0​,…,Ar,n−1​) is the rrr-th row regarded as a vector in Cn\mathbb{C}^nCn.

Admissible distribution (IsAdmissible\mathrm{IsAdmissible}IsAdmissible). For a measure ν\nuν on C\mathbb{C}C and a real number MMM, IsAdmissible(ν,M)\mathrm{IsAdmissible}(\nu, M)IsAdmissible(ν,M) means that all of the following hold, writing d∼νd \sim \nud∼ν:

  • ν\nuν is a probability measure;
  • ν\nuν is symmetric: the law of −d-d−d equals ν\nuν;
  • ∣d∣≤M|d| \le M∣d∣≤M holds ν\nuν-almost surely;
  • E d=0\mathbb{E}\,d = 0Ed=0;
  • E d2=0\mathbb{E}\,d^2 = 0Ed2=0 (the square, not the modulus squared);
  • E ∣d∣4=2 (E ∣d∣2)2\mathbb{E}\,|d|^4 = 2\,\big(\mathbb{E}\,|d|^2\big)^2E∣d∣4=2(E∣d∣2)2.

By the almost-sure bound, all these expectations are of bounded variables. No normalization such as E∣d∣2=1\mathbb{E}|d|^2 = 1E∣d∣2=1 is imposed, and E∣d∣2=0\mathbb{E}|d|^2 = 0E∣d∣2=0 is not excluded. The point mass at 000 satisfies every condition for any M≥0M \ge 0M≥0. If M<0M < 0M<0, no ν\nuν is admissible.

Coded diffraction model (cdpModel\mathrm{cdpModel}cdpModel). For a measure ν\nuν on C\mathbb{C}C (not required here to be a probability measure) and natural numbers L,nL, nL,n, cdpModel(ν,L,n)\mathrm{cdpModel}(\nu, L, n)cdpModel(ν,L,n) is the product measure on L×nL \times nL×n arrays d=(dℓ(t))d = (d_\ell(t))d=(dℓ​(t)), with ℓ<L\ell < Lℓ<L and t<nt < nt<n, in which every one of the LnLnLn entries has marginal ν\nuν and all entries are independent.

Coded diffraction sampling vectors (cdpVecs\mathrm{cdpVecs}cdpVecs). For an L×nL\times nL×n complex array d=(dℓ(t))d = (d_\ell(t))d=(dℓ​(t)), cdpVecs(d)\mathrm{cdpVecs}(d)cdpVecs(d) is the family of vectors a(ℓ,k)∈Cna_{(\ell,k)} \in \mathbb{C}^na(ℓ,k)​∈Cn, indexed by pairs (ℓ,k)(\ell, k)(ℓ,k) with 0≤ℓ<L0 \le \ell < L0≤ℓ<L and 0≤k<n0 \le k < n0≤k<n (so m=Lnm = Lnm=Ln vectors), with entries

a(ℓ,k)(t)=dℓ(t) e2πikt/n,t=0,…,n−1.a_{(\ell,k)}(t) = d_\ell(t)\, e^{2\pi i k t / n}, \qquad t = 0, \dots, n-1 .a(ℓ,k)​(t)=dℓ​(t)e2πikt/n,t=0,…,n−1.

Consequently,

a(ℓ,k)∗x=∑t=0n−1xt dℓ(t)‾ e−2πikt/n.a_{(\ell,k)}^* x = \sum_{t=0}^{n-1} x_t\, \overline{d_\ell(t)}\, e^{-2\pi i k t/n}.a(ℓ,k)∗​x=t=0∑n−1​xt​dℓ​(t)​e−2πikt/n.

When n=0n = 0n=0 or L=0L = 0L=0, the index set is empty.

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