Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Atomic norm, Toeplitz SDPs, Fejér-kernel system matrices and sampling models for compressed sensing off the grid

Definition
CSOffTheGrid_Basic

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

atomic-normcompressed-sensingdual-certificateline-spectral-estimationsemidefinite-programming

Objects of Sections 1, 2 and 4 of Tang, Bhaskar, Shah and Recht, Compressed Sensing Off the Grid (2013).

  1. Index sets and atoms. JJJ is either {0,…,n−1}\{0,\dots,n-1\}{0,…,n−1} or {−2M,…,2M}\{-2M,\dots,2M\}{−2M,…,2M}. For a frequency f∈[0,1]f\in[0,1]f∈[0,1] (with 000 and 111 identified) and a phase ϕ∈[0,2π)\phi\in[0,2\pi)ϕ∈[0,2π), the atom a(f,ϕ)∈C∣J∣a(f,\phi)\in\mathbb C^{|J|}a(f,ϕ)∈C∣J∣ has entries [a(f,ϕ)]j=ei(2πfj+ϕ)[a(f,\phi)]_j=e^{i(2\pi fj+\phi)}[a(f,ϕ)]j​=ei(2πfj+ϕ). The signal with frequencies f1,…,fsf_1,\dots,f_sf1​,…,fs​ and coefficients c1,…,csc_1,\dots,c_sc1​,…,cs​ is x⋆=∑kck a(fk,0)x^\star=\sum_k c_k\,a(f_k,0)x⋆=∑k​ck​a(fk​,0), and sign⁡(c)=c/∣c∣\operatorname{sign}(c)=c/|c|sign(c)=c/∣c∣.
  2. Separation. ∣f−f′∣|f-f'|∣f−f′∣ is the wrap-around distance on the circle (the distance from f−f′f-f'f−f′ to the nearest integer), and Δf=min⁡k≠j∣fk−fj∣\Delta_f=\min_{k\ne j}|f_k-f_j|Δf​=mink=j​∣fk​−fj​∣.
  3. Atomic norm (Section 2). ∥x∥A=inf⁡{∑kck:x=∑kcka(fk,ϕk), ck≥0}\|x\|_{\mathcal A}=\inf\{\sum_k c_k: x=\sum_k c_k a(f_k,\phi_k),\ c_k\ge0\}∥x∥A​=inf{∑k​ck​:x=∑k​ck​a(fk​,ϕk​), ck​≥0} over finite decompositions, and ∥x∥A,0\|x\|_{\mathcal A,0}∥x∥A,0​ is the least number of atoms in such a decomposition.
  4. Toeplitz semidefinite programs. Toep⁡(u)\operatorname{Toep}(u)Toep(u) is the Hermitian Toeplitz matrix with first column uuu. The SDP value is inf⁡{12∣J∣trace⁡Toep⁡(u)+t2:[Toep⁡(u)xx∗t]⪰0}\inf\{\frac1{2|J|}\operatorname{trace}\operatorname{Toep}(u)+\frac t2: \left[\begin{smallmatrix}\operatorname{Toep}(u)&x\\x^*&t\end{smallmatrix}\right]\succeq0\}inf{2∣J∣1​traceToep(u)+2t​:[Toep(u)x∗​xt​]⪰0}, and the rank value is the minimum of rank⁡Toep⁡(u)\operatorname{rank}\operatorname{Toep}(u)rankToep(u) under the same constraint.
  5. Recovery and duality. x⋆x^\starx⋆ is the unique optimizer of min⁡∥x∥A\min\|x\|_{\mathcal A}min∥x∥A​ subject to xj=xj⋆x_j=x^\star_jxj​=xj⋆​, j∈Tj\in Tj∈T, if every other feasible xxx has strictly larger atomic norm. The dual polynomial of q∈C∣J∣q\in\mathbb C^{|J|}q∈C∣J∣ is Q(f)=∑j∈Jqje−i2πjfQ(f)=\sum_{j\in J}q_je^{-i2\pi jf}Q(f)=∑j∈J​qj​e−i2πjf. A dual certificate satisfies Q(fk)=sign⁡(ck)Q(f_k)=\operatorname{sign}(c_k)Q(fk​)=sign(ck​), ∣Q(f)∣<1|Q(f)|<1∣Q(f)∣<1 for f∉{fk}f\notin\{f_k\}f∈/{fk​}, and qj=0q_j=0qj​=0 for j∉Tj\notin Tj∈/T. The dual SDP (2.13)–(2.15) has feasible pairs (q,H)(q,H)(q,H) with [H−q−q∗1]⪰0\left[\begin{smallmatrix}H&-q\\-q^*&1\end{smallmatrix}\right]\succeq0[H−q∗​−q1​]⪰0, the diagonal sums of HHH equal to 111 (main diagonal) and 000 (other diagonals), HHH Hermitian and qTc=0q_{T^c}=0qTc​=0. Its objective is Re⁡⟨qT,xT⟩\operatorname{Re}\langle q_T,x_T\rangleRe⟨qT​,xT​⟩, and D\mathcal DD is its set of optimal solutions.
  6. Kernels (Section 4). gM(j)=1M∑k=max⁡(j−M,−M)min⁡(j+M,M)(1−∣k/M∣)(1−∣j/M−k/M∣)g_M(j)=\frac1M\sum_{k=\max(j-M,-M)}^{\min(j+M,M)}(1-|k/M|)(1-|j/M-k/M|)gM​(j)=M1​∑k=max(j−M,−M)min(j+M,M)​(1−∣k/M∣)(1−∣j/M−k/M∣). The squared Fejér kernel is KˉM(f)=1M∑j=−2M2MgM(j)e−i2πfj\bar K_M(f)=\frac1M\sum_{j=-2M}^{2M}g_M(j)e^{-i2\pi fj}KˉM​(f)=M1​∑j=−2M2M​gM​(j)e−i2πfj, and its derivatives are KˉM(ℓ)(f)=1M∑j(−i2πj)ℓgM(j)e−i2πfj\bar K_M^{(\ell)}(f)=\frac1M\sum_j(-i2\pi j)^\ell g_M(j)e^{-i2\pi fj}KˉM(ℓ)​(f)=M1​∑j​(−i2πj)ℓgM​(j)e−i2πfj. The random kernel KMK_MKM​ keeps only the terms with j∈Tj\in Tj∈T.
  7. System matrices. With [Dℓ]jk=K(ℓ)(fj−fk)[D_\ell]_{jk}=K^{(\ell)}(f_j-f_k)[Dℓ​]jk​=K(ℓ)(fj​−fk​) and κ=∣KˉM′′(0)∣\kappa=|\bar K_M''(0)|κ=∣KˉM′′​(0)∣, the system matrix is [D0D1/κ−D1/κ−D2/κ]\left[\begin{smallmatrix}D_0&D_1/\sqrt\kappa\\-D_1/\sqrt\kappa&-D_2/\kappa\end{smallmatrix}\right][D0​−D1​/κ​​D1​/κ​−D2​/κ​]. It is Dˉ\bar DDˉ for KˉM\bar K_MKˉM​ and DDD for KMK_MKM​. Lˉ\bar LLˉ and LLL are the first sss columns of Dˉ−1\bar D^{-1}Dˉ−1 and D−1D^{-1}D−1, and ∥⋅∥\|\cdot\|∥⋅∥ is the operator norm.
  8. Probability models. In the Bernoulli model the indicators δj\delta_jδj​, j∈Jj\in Jj∈J, are i.i.d. with P(δj=1)=pP(\delta_j=1)=pP(δj​=1)=p, and T={j:δj=1}T=\{j:\delta_j=1\}T={j:δj​=1}. In the uniform model TTT is a uniformly random mmm-subset of JJJ. The signs uk=sign⁡(ck)u_k=\operatorname{sign}(c_k)uk​=sign(ck​) are i.i.d., independent of TTT, with either the uniform law on the unit circle or a symmetric law (invariant under u↦−uu\mapsto-uu↦−u) carried by the unit circle.

Formalization Note Vectors in C∣J∣\mathbb C^{|J|}C∣J∣ are functions on JJJ. Toep⁡(u)\operatorname{Toep}(u)Toep(u) takes uuu as the list of its sub-diagonal entries, ud=Toep⁡(u)j+d,ju_d=\operatorname{Toep}(u)_{j+d,j}ud​=Toep(u)j+d,j​. The derivatives KˉM(ℓ)\bar K_M^{(\ell)}KˉM(ℓ)​ are defined by the termwise-differentiated expansion (4.2), and ∣KˉM′′(0)∣|\bar K_M''(0)|∣KˉM′′​(0)∣ is the modulus of KˉM′′(0)\bar K_M''(0)KˉM′′​(0). Probabilities are explicit finite averages over TTT combined with the product law of the signs. A failure probability is the measure of the failure event, which for a non-measurable set is its outer measure, so a bound on it is never weaker than the paper's.

Definition code
import Mathlib

/-!
Tang, Bhaskar, Shah and Recht, *Compressed Sensing Off the Grid*, arXiv:1207.6053v3 (2013):
the signal model of Section 1 (eq. (1.1)), the atomic norm and its semidefinite characterization
of Section 2 (eqs. (2.1)-(2.19)), the squared Fejér kernel, its random analogue and the
interpolation system matrices of Section 4 (eqs. (4.2), (4.6), (4.24)-(4.26)), and the uniform,
Bernoulli and random-sign observation models of Theorems 1.1 and 2.3 and Section 4.2.
-/

open MeasureTheory

open scoped ENNReal ComplexOrder

noncomputable section

namespace CSOffTheGrid

/-- Theorem 1.1, p. 2: the wrap-around distance `|a - b|` on the unit circle `[0,1]` with `0` and
`1` identified, i.e. the distance from `a - b` to the nearest integer. -/
def wrapDist (a b : ℝ) : ℝ := |(a - b) - round (a - b)|

/-- Theorem 1.1, p. 2: the frequencies `f₁, …, f_s` satisfy `Δ_f = min_{k ≠ j} |f_k - f_j| ≥ sep`
(wrap-around distance); for `s ≤ 1` the minimum is over the empty set and the condition holds. -/
def IsSeparated {s : ℕ} (f : Fin s → ℝ) (sep : ℝ) : Prop :=
  ∀ k j, k ≠ j → sep ≤ wrapDist (f k) (f j)

/-- Section 2, p. 4: the symmetric index set `J = {-2M, …, 2M}`. -/
def symJ (M : ℕ) : Finset ℤ := Finset.Icc (-(2 * (M : ℤ))) (2 * (M : ℤ))

/-- Section 2, p. 4: the index set `J = {0, …, n-1}`. -/
def stdJ (n : ℕ) : Finset ℤ := Finset.Ico 0 (n : ℤ)

/-- Section 2, p. 4: the atom `a(f, φ) ∈ ℂ^{|J|}`, `[a(f, φ)]_j = e^{i(2π f j + φ)}`, `j ∈ J`. -/
def atom (J : Finset ℤ) (f φ : ℝ) : J → ℂ :=
  fun j => Complex.exp (Complex.I * ((2 * Real.pi * f * ((j : ℤ) : ℝ) + φ : ℝ) : ℂ))

/-- Eqs. (1.1) and (2.1): the signal `x⋆_j = ∑_k c_k e^{i 2π f_k j}`, `j ∈ J`. -/
def signal (J : Finset ℤ) {s : ℕ} (f : Fin s → ℝ) (c : Fin s → ℂ) : J → ℂ :=
  ∑ k, c k • atom J (f k) 0

/-- Theorem 1.1, p. 2: the complex sign `sign(c) = c / |c|`. -/
def csign (z : ℂ) : ℂ := z / (‖z‖ : ℂ)

/-- Section 2, p. 4: the atomic norm
`‖x‖_A = inf { ∑_k c_k : x = ∑_k c_k a(f_k, φ_k), c_k ≥ 0, f_k ∈ [0,1], φ_k ∈ [0, 2π) }`,
the infimum being over finite decompositions. -/
def atomicNorm (J : Finset ℤ) (x : J → ℂ) : ℝ :=
  sInf {t : ℝ | ∃ (r : ℕ) (c f φ : Fin r → ℝ), (∀ k, 0 ≤ c k) ∧ (∀ k, f k ∈ Set.Icc (0 : ℝ) 1) ∧
    (∀ k, φ k ∈ Set.Ico (0 : ℝ) (2 * Real.pi)) ∧ x = ∑ k, (c k : ℂ) • atom J (f k) (φ k) ∧
    t = ∑ k, c k}

/-- Section 2.2, p. 11: `‖x‖_{A,0}`, the least number of atoms `a(f_k, φ_k)` with nonnegative
coefficients `c_k` whose combination `∑_k c_k a(f_k, φ_k)` equals `x`. -/
def atomicL0 (J : Finset ℤ) (x : J → ℂ) : ℕ :=
  sInf {s : ℕ | ∃ (c f φ : Fin s → ℝ), (∀ k, 0 ≤ c k) ∧ (∀ k, f k ∈ Set.Icc (0 : ℝ) 1) ∧
    (∀ k, φ k ∈ Set.Ico (0 : ℝ) (2 * Real.pi)) ∧ x = ∑ k, (c k : ℂ) • atom J (f k) (φ k)}

/-- Proposition 2.1, p. 5: `Toep(u)`, the Hermitian Toeplitz matrix on `J` whose first column is
`u`. Here `u k` is the entry `k` places below the diagonal (`k = 0, …, |J| - 1`), so the entry in
row `j` and column `l` is `u (j - l)` for `j ≥ l` and the conjugate of `u (l - j)` for `j < l`. -/
def toep (J : Finset ℤ) (u : ℤ → ℂ) : Matrix J J ℂ :=
  fun j l => if (l : ℤ) ≤ (j : ℤ) then u ((j : ℤ) - (l : ℤ)) else star (u ((l : ℤ) - (j : ℤ)))

/-- Eq. (2.2): the block matrix `[[Toep(u), x], [x^*, t]]`. -/
def sdpBlock (J : Finset ℤ) (u : ℤ → ℂ) (x : J → ℂ) (t : ℝ) : Matrix (J ⊕ Unit) (J ⊕ Unit) ℂ :=
  Matrix.fromBlocks (toep J u) (Matrix.of fun j (_ : Unit) => x j)
    (Matrix.of fun (_ : Unit) j => star (x j)) (Matrix.of fun _ _ => (t : ℂ))

/-- Eq. (2.2): the value of the semidefinite program
`inf { (1/(2|J|)) trace(Toep(u)) + t/2 : [[Toep(u), x], [x^*, t]] ⪰ 0 }`. -/
def sdpValue (J : Finset ℤ) (x : J → ℂ) : ℝ :=
  sInf {v : ℝ | ∃ (u : ℤ → ℂ) (t : ℝ), (sdpBlock J u x t).PosSemidef ∧
    v = 1 / (2 * (J.card : ℝ)) * (Matrix.trace (toep J u)).re + t / 2}

/-- Eq. (2.19): the optimal value of `minimize rank(Toep(u))` subject to
`[[Toep(u), x], [x^*, t]] ⪰ 0`. -/
def rankValue (J : Finset ℤ) (x : J → ℂ) : ℕ :=
  sInf {r : ℕ | ∃ (u : ℤ → ℂ) (t : ℝ), (sdpBlock J u x t).PosSemidef ∧ r = (toep J u).rank}

/-- Eq. (2.9): the dual polynomial `Q(f) = ⟨q, a(f,0)⟩ = ∑_{j ∈ J} q_j e^{-i 2π j f}`. -/
def dualPoly (J : Finset ℤ) (q : J → ℂ) (f : ℝ) : ℂ :=
  ∑ j : J, q j * Complex.exp (-(((2 * Real.pi * f * ((j : ℤ) : ℝ) : ℝ) : ℂ) * Complex.I))

/-- Eq. (2.5) and Theorem 2.3, p. 7: `x⋆` is the unique optimizer of
`minimize ‖x‖_A subject to x_j = x⋆_j, j ∈ T`. -/
def IsUniqueOptimizer (J T : Finset ℤ) (xs : J → ℂ) : Prop :=
  ∀ x : J → ℂ, (∀ j : J, (j : ℤ) ∈ T → x j = xs j) → x ≠ xs → atomicNorm J xs < atomicNorm J x

/-- Proposition 2.4, eqs. (2.10)-(2.12): `q` is a dual certificate for the frequencies `f_k` and
coefficients `c_k`: `Q(f_k) = sign(c_k)`, `|Q(f)| < 1` for every `f` not equal (on the circle) to
any `f_k`, and `q_j = 0` for `j ∉ T`. -/
def IsDualCertificate (J T : Finset ℤ) {s : ℕ} (f : Fin s → ℝ) (c : Fin s → ℂ) (q : J → ℂ) :
    Prop :=
  (∀ j : J, (j : ℤ) ∉ T → q j = 0) ∧ (∀ k, dualPoly J q (f k) = csign (c k)) ∧
    ∀ g : ℝ, (∀ k, wrapDist g (f k) ≠ 0) → ‖dualPoly J q g‖ < 1

/-- Eq. (2.13): the block matrix `[[H, -q], [-q^*, 1]]` of the dual semidefinite program. -/
def dualBlock (J : Finset ℤ) (q : J → ℂ) (H : Matrix J J ℂ) : Matrix (J ⊕ Unit) (J ⊕ Unit) ℂ :=
  Matrix.fromBlocks H (Matrix.of fun j (_ : Unit) => -q j)
    (Matrix.of fun (_ : Unit) j => -star (q j)) (Matrix.of fun _ _ => 1)

/-- Eqs. (2.13)-(2.15) with `q_{T^c} = 0`: feasibility for the dual semidefinite program,
`[[H, -q], [-q^*, 1]] ⪰ 0`, `∑_k H_{k,k+d} = 1` for `d = 0` and `= 0` for `d = 1, …, |J|-1`
(sums along the diagonals of `H`), `H` Hermitian, and `q_j = 0` for `j ∉ T`. -/
def IsDualFeasible (J T : Finset ℤ) (q : J → ℂ) (H : Matrix J J ℂ) : Prop :=
  (dualBlock J q H).PosSemidef ∧
    (∀ d : ℕ, d < J.card →
      (∑ a : J, ∑ b : J, if (b : ℤ) - (a : ℤ) = (d : ℤ) then H a b else 0) =
        if d = 0 then 1 else 0) ∧
    H.IsHermitian ∧ ∀ j : J, (j : ℤ) ∉ T → q j = 0

/-- Eq. (2.13): the dual objective `⟨q_T, x_T⟩_ℝ = Re ∑_{j ∈ T} conj(x_j) q_j`. -/
def dualObjective (J T : Finset ℤ) (x q : J → ℂ) : ℝ :=
  (∑ j : J, if (j : ℤ) ∈ T then star (x j) * q j else 0).re

/-- Proposition 2.5, p. 10: the set `𝒟` of optimal solutions `(q, H)` of the dual semidefinite
program (2.13)-(2.15) for the data `x_T`. -/
def dualOptimalSet (J T : Finset ℤ) (x : J → ℂ) : Set ((J → ℂ) × Matrix J J ℂ) :=
  {p | IsDualFeasible J T p.1 p.2 ∧
    ∀ p' : (J → ℂ) × Matrix J J ℂ, IsDualFeasible J T p'.1 p'.2 →
      dualObjective J T x p'.1 ≤ dualObjective J T x p.1}

/-- Eq. (4.2): `g_M(j) = (1/M) ∑_{k = max(j-M, -M)}^{min(j+M, M)} (1 - |k/M|)(1 - |j/M - k/M|)`,
the discrete convolution of two triangular functions. -/
def gM (M : ℕ) (j : ℤ) : ℝ :=
  1 / (M : ℝ) * ∑ k ∈ Finset.Icc (max (j - M) (-(M : ℤ))) (min (j + M) (M : ℤ)),
    (1 - |(k : ℝ) / M|) * (1 - |(j : ℝ) / M - (k : ℝ) / M|)

/-- Eq. (4.2) and p. 16: the `ℓ`-th derivative of the squared Fejér kernel
`K̄_M(f) = [sin(π M f) / (M sin(π f))]^4 = (1/M) ∑_{j=-2M}^{2M} g_M(j) e^{-i 2π f j}`, i.e.
`K̄_M^{(ℓ)}(f) = (1/M) ∑_{j=-2M}^{2M} (-i 2π j)^ℓ g_M(j) e^{-i 2π f j}`. -/
def kerBarDeriv (M ℓ : ℕ) (f : ℝ) : ℂ :=
  1 / (M : ℂ) * ∑ j ∈ symJ M, (-2 * (Real.pi : ℂ) * Complex.I * (j : ℂ)) ^ ℓ * (gM M j : ℂ) *
    Complex.exp (-(((2 * Real.pi * f * (j : ℝ) : ℝ) : ℂ) * Complex.I))

/-- Section 4.3, p. 19: the `ℓ`-th derivative of the random kernel
`K_M(f) = (1/M) ∑_{j ∈ T} g_M(j) e^{-i 2π f j}` for the observed index set `T ⊆ J`, i.e.
`K_M^{(ℓ)}(f) = (1/M) ∑_{j=-2M}^{2M} (-i 2π j)^ℓ g_M(j) δ_j e^{-i 2π f j}` with `δ_j = 1_{j ∈ T}`. -/
def kerRandDeriv (M : ℕ) (T : Finset ℤ) (ℓ : ℕ) (f : ℝ) : ℂ :=
  1 / (M : ℂ) * ∑ j ∈ (symJ M).filter (· ∈ T),
    (-2 * (Real.pi : ℂ) * Complex.I * (j : ℂ)) ^ ℓ * (gM M j : ℂ) *
      Complex.exp (-(((2 * Real.pi * f * (j : ℝ) : ℝ) : ℂ) * Complex.I))

/-- Section 4.1, p. 16: `|K̄_M''(0)|` (which equals `4π²(M² - 1)/3`). -/
def kerCurv (M : ℕ) : ℝ := ‖kerBarDeriv M 2 0‖

/-- Eqs. (4.6) and (4.24): the `2s × 2s` system matrix built from a kernel with derivatives
`K^{(ℓ)}` and the normalization `κ = |K̄_M''(0)|`:
`[[D₀, D₁/√κ], [-D₁/√κ, -D₂/κ]]` with `[D_ℓ]_{jk} = K^{(ℓ)}(f_j - f_k)`. -/
def sysMatOf {s : ℕ} (K : ℕ → ℝ → ℂ) (κ : ℝ) (f : Fin s → ℝ) :
    Matrix (Fin s ⊕ Fin s) (Fin s ⊕ Fin s) ℂ :=
  Matrix.fromBlocks (Matrix.of fun j k => K 0 (f j - f k))
    (Matrix.of fun j k => K 1 (f j - f k) / (Real.sqrt κ : ℂ))
    (Matrix.of fun j k => -(K 1 (f j - f k) / (Real.sqrt κ : ℂ)))
    (Matrix.of fun j k => -(K 2 (f j - f k) / (κ : ℂ)))

/-- Eq. (4.6): the deterministic system matrix `D̄` of the squared Fejér kernel `K̄_M`. -/
def sysMatBar (M : ℕ) {s : ℕ} (f : Fin s → ℝ) : Matrix (Fin s ⊕ Fin s) (Fin s ⊕ Fin s) ℂ :=
  sysMatOf (kerBarDeriv M) (kerCurv M) f

/-- Eq. (4.24): the random system matrix `D` of the random kernel `K_M` for the observed set `T`,
normalized by the deterministic `|K̄_M''(0)|`. -/
def sysMat (M : ℕ) (T : Finset ℤ) {s : ℕ} (f : Fin s → ℝ) :
    Matrix (Fin s ⊕ Fin s) (Fin s ⊕ Fin s) ℂ :=
  sysMatOf (kerRandDeriv M T) (kerCurv M) f

/-- Pp. 17 and 22: the left `2s × s` block `L` of a `2s × 2s` matrix `[L R]` (its first `s`
columns); applied to `D̄⁻¹` it gives `L̄`, applied to `D⁻¹` it gives `L`. -/
def leftBlock {s : ℕ} (A : Matrix (Fin s ⊕ Fin s) (Fin s ⊕ Fin s) ℂ) :
    Matrix (Fin s ⊕ Fin s) (Fin s) ℂ :=
  A.submatrix id Sum.inl

/-- Proposition 4.1, p. 17: the matrix operator norm `‖A‖` (largest singular value), the norm of
`A` as a linear map between Euclidean spaces. -/
def opNorm {m n : Type*} [Fintype m] [Fintype n] [DecidableEq n] (A : Matrix m n ℂ) : ℝ :=
  ‖LinearMap.toContinuousLinearMap (Matrix.toEuclideanLin A)‖

open Classical in
/-- Section 4.2, p. 18: the probability of an event `E` about the observed set
`T = {j ∈ J : δ_j = 1}` when the `δ_j`, `j ∈ J`, are i.i.d. Bernoulli with `P(δ_j = 1) = p`:
`∑_{T ⊆ J, E(T)} p^{|T|} (1-p)^{|J| - |T|}`. -/
def bernoulliProb (J : Finset ℤ) (p : ℝ) (E : Finset ℤ → Prop) : ℝ :=
  ∑ T ∈ J.powerset, if E T then p ^ T.card * (1 - p) ^ (J.card - T.card) else 0

/-- Theorem 1.1, p. 2: the uniform distribution on the complex unit circle, the law of `e^{iθ}`
for `θ` uniform on `[0, 2π)`. -/
def uniformCircle : Measure ℂ :=
  ENNReal.ofReal (1 / (2 * Real.pi)) •
    (volume.restrict (Set.Ico (0 : ℝ) (2 * Real.pi))).map
      (fun θ : ℝ => Complex.exp ((θ : ℂ) * Complex.I))

/-- Theorem 2.3, p. 7: `μ` is a symmetric distribution on the complex unit circle: a probability
measure on `ℂ` carried by the unit circle and invariant under `u ↦ -u`. -/
def IsSymmetricCircleLaw (μ : Measure ℂ) : Prop :=
  IsProbabilityMeasure μ ∧ μ (Metric.sphere (0 : ℂ) 1)ᶜ = 0 ∧ μ.map Neg.neg = μ

/-- Theorems 1.1 and 2.3: the probability that `good T u` fails when the index set `T ⊆ J` of size
`m` is selected uniformly at random and, independently, the signs `u_1, …, u_s` are i.i.d. with
law `μ`: `(1 / #{T ⊆ J : |T| = m}) ∑_{T ⊆ J, |T| = m} μ^{⊗s}{u : ¬ good T u}`. -/
def uniformFailureProb (J : Finset ℤ) (m s : ℕ) (μ : Measure ℂ)
    (good : Finset ℤ → (Fin s → ℂ) → Prop) : ℝ≥0∞ :=
  ((J.powersetCard m).card : ℝ≥0∞)⁻¹ *
    ∑ T ∈ J.powersetCard m, (Measure.pi fun _ : Fin s => μ) {u | ¬ good T u}

end CSOffTheGrid
Source
Tang, Bhaskar, Shah and Recht, Compressed Sensing Off the Grid, arXiv:1207.6053v3 (2013), Section 1 (eq. 1.1), Section 2 (eqs. 2.1-2.19), Sections 4.1-4.4 (eqs. 4.2, 4.6, 4.24-4.26)
Read-back

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

wrapDist. For real numbers a,ba, ba,b, the wrap-around distance is

d(a,b)=∣ (a−b)−round⁡(a−b) ∣,d(a,b) = \bigl|\,(a-b) - \operatorname{round}(a-b)\,\bigr|,d(a,b)=​(a−b)−round(a−b)​,

where round⁡(x)\operatorname{round}(x)round(x) is the nearest integer to xxx, with halves rounded up (round⁡(x)=⌊x+12⌋\operatorname{round}(x)=\lfloor x+\tfrac12\rfloorround(x)=⌊x+21​⌋). It is the distance from a−ba-ba−b to the nearest integer, so it always lies in [0,12][0,\tfrac12][0,21​]. It equals 000 exactly when a−ba-ba−b is an integer. It is defined for all real a,ba, ba,b, not only for points of [0,1][0,1][0,1].

IsSeparated. For a natural number sss, frequencies f1,…,fs∈Rf_1,\dots,f_s \in \mathbb{R}f1​,…,fs​∈R (indexed by {0,…,s−1}\{0,\dots,s-1\}{0,…,s−1}) and a real number sep\mathrm{sep}sep, the property holds if and only if

sep≤d(fk,fj)for all indices k≠j,\mathrm{sep} \le d(f_k, f_j) \quad \text{for all indices } k \ne j,sep≤d(fk​,fj​)for all indices k=j,

with ddd the wrap-around distance above. Edge cases:

  • For s≤1s \le 1s≤1 there are no pairs, so the property holds for every sep\mathrm{sep}sep.
  • For sep≤0\mathrm{sep} \le 0sep≤0 it holds for every fff.
  • Since d≤12d \le \tfrac12d≤21​, it fails for every fff when s≥2s \ge 2s≥2 and sep>12\mathrm{sep} > \tfrac12sep>21​.
  • No requirement fk∈[0,1]f_k \in [0,1]fk​∈[0,1] is imposed.

symJ. For a natural number MMM, this is the set of integers {−2M,−2M+1,…,2M}\{-2M, -2M+1, \dots, 2M\}{−2M,−2M+1,…,2M}. It has 4M+14M+14M+1 elements, and for M=0M=0M=0 it is {0}\{0\}{0}.

stdJ. For a natural number nnn, this is the set of integers {0,1,…,n−1}\{0,1,\dots,n-1\}{0,1,…,n−1}. It is empty when n=0n=0n=0.

atom. For a finite set of integers JJJ and reals f,φf, \varphif,φ, the atom aJ(f,φ)a_J(f,\varphi)aJ​(f,φ) is the complex vector indexed by the elements j∈Jj \in Jj∈J with entries

[aJ(f,φ)]j=e i(2πfj+φ),j∈J.[a_J(f,\varphi)]_j = e^{\,i(2\pi f j + \varphi)}, \qquad j \in J .[aJ​(f,φ)]j​=ei(2πfj+φ),j∈J.

Here fff and φ\varphiφ are arbitrary reals; no range restriction is imposed.

signal. For a finite set of integers JJJ, a natural number sss, real frequencies f1,…,fsf_1,\dots,f_sf1​,…,fs​ and complex coefficients c1,…,csc_1,\dots,c_sc1​,…,cs​, the signal is the vector in CJ\mathbb{C}^JCJ given by

x⋆=∑k=1sck aJ(fk,0),xj⋆=∑k=1sck e i2πfkj,j∈J.x^\star = \sum_{k=1}^{s} c_k\, a_J(f_k, 0), \qquad x^\star_j = \sum_{k=1}^{s} c_k\, e^{\,i 2\pi f_k j}, \quad j \in J.x⋆=k=1∑s​ck​aJ​(fk​,0),xj⋆​=k=1∑s​ck​ei2πfk​j,j∈J.

For s=0s=0s=0 it is the zero vector. No conditions are placed on the fkf_kfk​ (distinctness, range) or the ckc_kck​ (they may be 000).

csign. For a complex number zzz, sign⁡(z)=z/∣z∣\operatorname{sign}(z) = z/|z|sign(z)=z/∣z∣. By the convention that division by zero gives 000, sign⁡(0)=0\operatorname{sign}(0) = 0sign(0)=0. For z≠0z \neq 0z=0 it is the unit-modulus number in the direction of zzz.

atomicNorm. For a finite set of integers JJJ and a vector x∈CJx \in \mathbb{C}^Jx∈CJ, ∥x∥A\|x\|_{\mathcal A}∥x∥A​ is the infimum of the set of real numbers

{ ∑k=1rck : r∈N, ck≥0, fk∈[0,1], φk∈[0,2π), x=∑k=1rck aJ(fk,φk) },\Bigl\{\ \sum_{k=1}^{r} c_k \ :\ r \in \mathbb{N},\ c_k \ge 0,\ f_k \in [0,1],\ \varphi_k \in [0,2\pi),\ x = \sum_{k=1}^{r} c_k\, a_J(f_k,\varphi_k)\ \Bigr\},{ k=1∑r​ck​ : r∈N, ck​≥0, fk​∈[0,1], φk​∈[0,2π), x=k=1∑r​ck​aJ​(fk​,φk​) },

where the infimum ranges over all finite lengths rrr (including r=0r=0r=0) and all real tuples (ck),(fk),(φk)(c_k), (f_k), (\varphi_k)(ck​),(fk​),(φk​) meeting these constraints. Further details:

  • The frequency interval [0,1][0,1][0,1] is closed, so it includes both endpoints.
  • Zero coefficients are allowed.
  • For x=0x = 0x=0, the empty decomposition gives the value 000.
  • Every element of the set is ≥0\ge 0≥0, so the set is bounded below.
  • By the convention for real infima, if the set were empty the value would be 000.

atomicL0. For a finite set of integers JJJ and x∈CJx \in \mathbb{C}^Jx∈CJ, ∥x∥A,0\|x\|_{\mathcal A,0}∥x∥A,0​ is the least natural number sss such that there exist reals c1,…,cs≥0c_1,\dots,c_s \ge 0c1​,…,cs​≥0, f1,…,fs∈[0,1]f_1,\dots,f_s \in [0,1]f1​,…,fs​∈[0,1] and φ1,…,φs∈[0,2π)\varphi_1,\dots,\varphi_s \in [0,2\pi)φ1​,…,φs​∈[0,2π) with

x=∑k=1sck aJ(fk,φk).x = \sum_{k=1}^{s} c_k\, a_J(f_k,\varphi_k).x=k=1∑s​ck​aJ​(fk​,φk​).

Edge cases:

  • Zero coefficients are permitted.
  • For x=0x=0x=0 the value is 000.
  • By the convention for infima of sets of natural numbers, if no such sss existed the value would be 000.

toep. For a finite set of integers JJJ and a function u:Z→Cu:\mathbb{Z}\to\mathbb{C}u:Z→C, Toep⁡J(u)\operatorname{Toep}_J(u)ToepJ​(u) is the J×JJ\times JJ×J complex matrix with entries

[Toep⁡J(u)]j,l={u(j−l),l≤j,u(l−j)‾,j<l,[\operatorname{Toep}_J(u)]_{j,l} = \begin{cases} u(j-l), & l \le j,\\[2pt] \overline{u(l-j)}, & j < l, \end{cases}[ToepJ​(u)]j,l​={u(j−l),u(l−j)​,​l≤j,j<l,​

where j,lj, lj,l are the integer labels in JJJ, and the differences are differences of those labels. Consequences of this form:

  • Only the values u(d)u(d)u(d) at differences d≥0d \ge 0d≥0 of elements of JJJ are used.
  • If JJJ is not a set of consecutive integers, some differences are skipped.
  • The diagonal entries are u(0)u(0)u(0), with no conjugation. The matrix is therefore Hermitian exactly when J=∅J=\emptysetJ=∅ or u(0)u(0)u(0) is real; nothing forces u(0)u(0)u(0) to be real.

sdpBlock. For a finite set of integers JJJ, u:Z→Cu:\mathbb{Z}\to\mathbb{C}u:Z→C, x∈CJx\in\mathbb{C}^Jx∈CJ and a real ttt, this is the (∣J∣+1)×(∣J∣+1)(|J|+1)\times(|J|+1)(∣J∣+1)×(∣J∣+1) complex block matrix, indexed by JJJ together with one extra index:

(Toep⁡J(u)xx∗t).\begin{pmatrix} \operatorname{Toep}_J(u) & x \\ x^* & t \end{pmatrix}.(ToepJ​(u)x∗​xt​).

Here xxx is a column, x∗x^*x∗ is the row of complex conjugates xj‾\overline{x_j}xj​​, and ttt is the bottom-right scalar entry.

sdpValue. For a finite set of integers JJJ and x∈CJx \in \mathbb{C}^Jx∈CJ, this is the infimum of the set of reals

{ 12∣J∣ Re⁡tr⁡Toep⁡J(u)+t2 : u:Z→C, t∈R, (Toep⁡J(u)xx∗t)⪰0},\Bigl\{\ \frac{1}{2|J|}\,\operatorname{Re}\operatorname{tr}\operatorname{Toep}_J(u) + \frac{t}{2}\ :\ u:\mathbb{Z}\to\mathbb{C},\ t\in\mathbb{R},\ \begin{pmatrix} \operatorname{Toep}_J(u) & x \\ x^* & t \end{pmatrix} \succeq 0 \Bigr\},{ 2∣J∣1​RetrToepJ​(u)+2t​ : u:Z→C, t∈R, (ToepJ​(u)x∗​xt​)⪰0},

where ⪰0\succeq 0⪰0 means Hermitian positive semidefinite. In particular this forces u(0)u(0)u(0) to be real when J≠∅J \neq \emptysetJ=∅. Conventions and edge cases:

  • The objective uses the real part of the trace, which equals ∣J∣Re⁡u(0)|J|\operatorname{Re} u(0)∣J∣Reu(0).
  • If J=∅J=\emptysetJ=∅, then 12∣J∣\tfrac{1}{2|J|}2∣J∣1​ is interpreted as 1/0=01/0 = 01/0=0, and the objective is t/2t/2t/2.
  • By the convention for real infima, the value is 000 if the set is empty or unbounded below.

rankValue. For a finite set of integers JJJ and x∈CJx\in\mathbb{C}^Jx∈CJ, this is the least natural number rrr such that some u:Z→Cu:\mathbb{Z}\to\mathbb{C}u:Z→C and real ttt satisfy two conditions:

  • the block matrix (Toep⁡J(u)xx∗t)\begin{pmatrix} \operatorname{Toep}_J(u) & x \\ x^* & t \end{pmatrix}(ToepJ​(u)x∗​xt​) is Hermitian positive semidefinite, and
  • r=rank⁡Toep⁡J(u)r = \operatorname{rank}\operatorname{Toep}_J(u)r=rankToepJ​(u), with rank taken over C\mathbb{C}C.

If no such (u,t)(u,t)(u,t) existed, the value would be 000 by convention.

dualPoly. For a finite set of integers JJJ, a vector q∈CJq\in\mathbb{C}^Jq∈CJ and a real fff,

Qq(f)=∑j∈Jqj e−i2πfj.Q_q(f) = \sum_{j\in J} q_j\, e^{-i 2\pi f j}.Qq​(f)=j∈J∑​qj​e−i2πfj.

The coefficients qjq_jqj​ appear unconjugated.

IsUniqueOptimizer. For finite sets of integers J,TJ, TJ,T and x⋆∈CJx^\star\in\mathbb{C}^Jx⋆∈CJ, the property holds if and only if the following is true for every x∈CJx\in\mathbb{C}^Jx∈CJ: if xj=xj⋆x_j = x^\star_jxj​=xj⋆​ for all j∈J∩Tj\in J\cap Tj∈J∩T and x≠x⋆x\neq x^\starx=x⋆, then

∥x⋆∥A<∥x∥A,\|x^\star\|_{\mathcal A} < \|x\|_{\mathcal A},∥x⋆∥A​<∥x∥A​,

with ∥⋅∥A\|\cdot\|_{\mathcal A}∥⋅∥A​ the atomic norm above, including its value-000 convention. Edge cases:

  • TTT is not required to be a subset of JJJ; only J∩TJ\cap TJ∩T matters.
  • If J⊆TJ\subseteq TJ⊆T, the only admissible xxx is x⋆x^\starx⋆, so the property holds vacuously.
  • The inequality is strict.

IsDualCertificate. For finite sets of integers J,TJ, TJ,T, a natural number sss, reals f1,…,fsf_1,\dots,f_sf1​,…,fs​, complex numbers c1,…,csc_1,\dots,c_sc1​,…,cs​ and q∈CJq\in\mathbb{C}^Jq∈CJ, the property holds if and only if all three of the following hold:

  1. qj=0q_j = 0qj​=0 for every j∈Jj \in Jj∈J with j∉Tj\notin Tj∈/T;
  2. Qq(fk)=sign⁡(ck)Q_q(f_k) = \operatorname{sign}(c_k)Qq​(fk​)=sign(ck​) for every kkk, where sign⁡(0)=0\operatorname{sign}(0)=0sign(0)=0, so a zero coefficient requires Qq(fk)=0Q_q(f_k)=0Qq​(fk​)=0;
  3. ∣Qq(g)∣<1|Q_q(g)| < 1∣Qq​(g)∣<1 for every real ggg such that d(g,fk)≠0d(g,f_k)\neq 0d(g,fk​)=0 for all kkk, that is, such that g−fkg - f_kg−fk​ is not an integer for every kkk.

For s=0s=0s=0, condition 2 is vacuous and condition 3 applies to every real ggg.

dualBlock. For a finite set of integers JJJ, q∈CJq\in\mathbb{C}^Jq∈CJ and a J×JJ\times JJ×J complex matrix HHH, this is the block matrix

(H−q−q∗1),\begin{pmatrix} H & -q \\ -q^* & 1 \end{pmatrix},(H−q∗​−q1​),

where −q-q−q is a column, −q∗-q^*−q∗ is the row of the numbers −qj‾-\overline{q_j}−qj​​, and the bottom-right entry is 111.

IsDualFeasible. For finite sets of integers J,TJ, TJ,T, q∈CJq\in\mathbb{C}^Jq∈CJ and a J×JJ\times JJ×J complex matrix HHH, the pair (q,H)(q,H)(q,H) is feasible if and only if all four of the following hold:

  1. (H−q−q∗1)\begin{pmatrix} H & -q \\ -q^* & 1 \end{pmatrix}(H−q∗​−q1​) is Hermitian positive semidefinite;
  2. for every natural number d<∣J∣d < |J|d<∣J∣,
∑a,b∈Jb−a=dHa,b={1,d=0,0,1≤d<∣J∣,\sum_{\substack{a,b\in J\\ b-a=d}} H_{a,b} = \begin{cases}1, & d=0,\\ 0, & 1\le d<|J|,\end{cases}a,b∈Jb−a=d​∑​Ha,b​={1,0,​d=0,1≤d<∣J∣,​

where b−ab-ab−a is the difference of the integer labels, so d=0d=0d=0 says tr⁡H=1\operatorname{tr}H = 1trH=1; 3. HHH is Hermitian; 4. qj=0q_j=0qj​=0 for every j∈Jj\in Jj∈J with j∉Tj\notin Tj∈/T.

Notes on condition 2:

  • Only the diagonals with nonnegative offsets d=0,…,∣J∣−1d = 0,\dots,|J|-1d=0,…,∣J∣−1 are constrained.
  • If JJJ is not a set of consecutive integers, label differences of ∣J∣|J|∣J∣ or more can occur, and the corresponding diagonals are unconstrained.
  • For J=∅J=\emptysetJ=∅, condition 2 is vacuous.

dualObjective. For finite sets of integers J,TJ, TJ,T and x,q∈CJx, q\in\mathbb{C}^Jx,q∈CJ,

⟨qT,xT⟩R=Re⁡∑j∈J∩Txj‾ qj.\langle q_T, x_T\rangle_{\mathbb{R}} = \operatorname{Re}\sum_{j\in J\cap T} \overline{x_j}\, q_j .⟨qT​,xT​⟩R​=Rej∈J∩T∑​xj​​qj​.

dualOptimalSet. For finite sets of integers J,TJ, TJ,T and x∈CJx\in\mathbb{C}^Jx∈CJ, D\mathcal{D}D is the set of pairs (q,H)(q,H)(q,H), with q∈CJq\in\mathbb{C}^Jq∈CJ and HHH a J×JJ\times JJ×J complex matrix, meeting two conditions:

  • (q,H)(q,H)(q,H) is dual feasible in the sense above, and
  • ⟨qT′,xT⟩R≤⟨qT,xT⟩R\langle q'_T, x_T\rangle_{\mathbb{R}} \le \langle q_T, x_T\rangle_{\mathbb{R}}⟨qT′​,xT​⟩R​≤⟨qT​,xT​⟩R​ for every dual-feasible pair (q′,H′)(q',H')(q′,H′).

That is, D\mathcal{D}D is the set of feasible maximizers of the dual objective. It is empty if the supremum is not attained.

gM. For a natural number MMM and an integer jjj,

gM(j)=1M∑k=max⁡(j−M, −M)min⁡(j+M, M)(1−∣kM∣)(1−∣jM−kM∣),g_M(j) = \frac{1}{M}\sum_{k=\max(j-M,\,-M)}^{\min(j+M,\,M)} \Bigl(1-\Bigl|\frac{k}{M}\Bigr|\Bigr)\Bigl(1-\Bigl|\frac{j}{M}-\frac{k}{M}\Bigr|\Bigr),gM​(j)=M1​k=max(j−M,−M)∑min(j+M,M)​(1−​Mk​​)(1−​Mj​−Mk​​),

where kkk runs over the integers in the indicated range. Edge cases:

  • The range is empty when max⁡(j−M,−M)>min⁡(j+M,M)\max(j-M,-M) > \min(j+M,M)max(j−M,−M)>min(j+M,M), which happens for ∣j∣>2M|j|>2M∣j∣>2M; then gM(j)=0g_M(j)=0gM​(j)=0.
  • For M=0M=0M=0, every division by MMM gives 000, so g0(j)=0g_0(j)=0g0​(j)=0 for all jjj.

kerBarDeriv. For natural numbers M,ℓM, \ellM,ℓ and a real fff,

KˉM(ℓ)(f)=1M∑j=−2M2M(−i2πj)ℓ gM(j) e−i2πfj,\bar K_M^{(\ell)}(f) = \frac{1}{M}\sum_{j=-2M}^{2M} (-i 2\pi j)^{\ell}\, g_M(j)\, e^{-i 2\pi f j},KˉM(ℓ)​(f)=M1​j=−2M∑2M​(−i2πj)ℓgM​(j)e−i2πfj,

with the convention 00=10^0 = 100=1 at j=0j=0j=0, ℓ=0\ell=0ℓ=0. For M=0M=0M=0 the value is 000. The definition is this finite trigonometric sum itself. Neither its identity with [sin⁡(πMf)/(Msin⁡πf)]4[\sin(\pi M f)/(M\sin \pi f)]^4[sin(πMf)/(Msinπf)]4 nor its identity with the ℓ\ellℓ-th derivative of that function is part of the definition.

kerRandDeriv. For natural numbers M,ℓM,\ellM,ℓ, a finite set of integers TTT and a real fff,

KM,T(ℓ)(f)=1M∑j∈{−2M,…,2M}j∈T(−i2πj)ℓ gM(j) e−i2πfj.K_{M,T}^{(\ell)}(f) = \frac{1}{M}\sum_{\substack{j\in\{-2M,\dots,2M\}\\ j\in T}} (-i 2\pi j)^{\ell}\, g_M(j)\, e^{-i 2\pi f j}.KM,T(ℓ)​(f)=M1​j∈{−2M,…,2M}j∈T​∑​(−i2πj)ℓgM​(j)e−i2πfj.

This is the same sum as KˉM(ℓ)\bar K_M^{(\ell)}KˉM(ℓ)​ but restricted to indices in TTT. The normalization is 1/M1/M1/M, with no rescaling by any sampling probability. For M=0M=0M=0 the value is 000. TTT is an arbitrary finite set of integers, not required to be a subset of {−2M,…,2M}\{-2M,\dots,2M\}{−2M,…,2M}.

kerCurv. For a natural number MMM,

κM=∣KˉM(2)(0)∣=∣1M∑j=−2M2M(−4π2j2) gM(j)∣,\kappa_M = \bigl|\bar K_M^{(2)}(0)\bigr| = \Bigl|\frac{1}{M}\sum_{j=-2M}^{2M} (-4\pi^2 j^2)\, g_M(j)\Bigr|,κM​=​KˉM(2)​(0)​=​M1​j=−2M∑2M​(−4π2j2)gM​(j)​,

which is 000 for M=0M=0M=0. No closed form is asserted.

sysMatOf. Given a natural number sss, any function KKK assigning to each natural number ℓ\ellℓ and real fff a complex number K(ℓ)(f)K^{(\ell)}(f)K(ℓ)(f), a real κ\kappaκ, and reals f1,…,fsf_1,\dots,f_sf1​,…,fs​, this is the 2s×2s2s\times 2s2s×2s complex block matrix

(D0D1/κ−D1/κ−D2/κ),[Dℓ]jk=K(ℓ)(fj−fk).\begin{pmatrix} D_0 & D_1/\sqrt{\kappa} \\ -D_1/\sqrt{\kappa} & -D_2/\kappa \end{pmatrix}, \qquad [D_\ell]_{jk} = K^{(\ell)}(f_j - f_k).(D0​−D1​/κ​​D1​/κ​−D2​/κ​),[Dℓ​]jk​=K(ℓ)(fj​−fk​).

Its rows and columns are indexed by two copies of {1,…,s}\{1,\dots,s\}{1,…,s}. Only K(0),K(1),K(2)K^{(0)}, K^{(1)}, K^{(2)}K(0),K(1),K(2) are used, and KKK need not consist of actual derivatives. Conventions for degenerate κ\kappaκ:

  • κ\sqrt{\kappa}κ​ is the real square root, which is 000 for κ≤0\kappa\le 0κ≤0.
  • Division by 000 gives 000.
  • For κ=0\kappa=0κ=0, the two off-diagonal blocks and the bottom-right block are zero.
  • For κ<0\kappa<0κ<0, the off-diagonal blocks are zero while the bottom-right block is −D2/κ-D_2/\kappa−D2​/κ.

sysMatBar. For natural numbers M,sM, sM,s and reals f1,…,fsf_1,\dots,f_sf1​,…,fs​, Dˉ\bar DDˉ is the matrix above with K(ℓ)=KˉM(ℓ)K^{(\ell)} = \bar K_M^{(\ell)}K(ℓ)=KˉM(ℓ)​ and κ=κM\kappa=\kappa_Mκ=κM​. For M=0M=0M=0 it is the zero matrix.

sysMat. For natural numbers M,sM, sM,s, a finite set of integers TTT and reals f1,…,fsf_1,\dots,f_sf1​,…,fs​, DDD is the matrix above with K(ℓ)=KM,T(ℓ)K^{(\ell)} = K_{M,T}^{(\ell)}K(ℓ)=KM,T(ℓ)​. The normalization is the deterministic κ=κM=∣KˉM(2)(0)∣\kappa=\kappa_M = |\bar K_M^{(2)}(0)|κ=κM​=∣KˉM(2)​(0)∣, not a quantity computed from the restricted kernel.

leftBlock. For a 2s×2s2s\times 2s2s×2s complex matrix AAA, with rows and columns indexed by two copies of {1,…,s}\{1,\dots,s\}{1,…,s}, this is the 2s×s2s\times s2s×s matrix consisting of all rows of AAA and the columns from the first copy. In other words, it is the left half LLL of A=[ L  R ]A = [\,L\ \ R\,]A=[L  R]. The definition applies to AAA itself; no inverse is taken.

opNorm. For finite index sets m,nm, nm,n and an m×nm\times nm×n complex matrix AAA, ∥A∥\|A\|∥A∥ is the operator norm of the linear map Cn→Cm\mathbb{C}^n\to\mathbb{C}^mCn→Cm, v↦Avv\mapsto Avv↦Av, when both spaces carry the Euclidean (ℓ2\ell^2ℓ2) norm:

∥A∥=sup⁡∥v∥2≤1∥Av∥2.\|A\| = \sup_{\|v\|_2\le 1}\|Av\|_2 .∥A∥=∥v∥2​≤1sup​∥Av∥2​.

This is the largest singular value of AAA.

bernoulliProb. For a finite set of integers JJJ, a real ppp and a property EEE of finite sets of integers,

PJ,p(E)=∑T⊆JE(T) holdsp∣T∣(1−p)∣J∣−∣T∣,P_{J,p}(E) = \sum_{\substack{T\subseteq J\\ E(T)\text{ holds}}} p^{|T|}(1-p)^{|J|-|T|},PJ,p​(E)=T⊆JE(T) holds​∑​p∣T∣(1−p)∣J∣−∣T∣,

with 00=10^0=100=1. Edge cases:

  • EEE is only evaluated on subsets of JJJ.
  • ppp is an arbitrary real number; it is not required to lie in [0,1][0,1][0,1]. Outside [0,1][0,1][0,1] the summands can be negative and the value is not a probability.

uniformCircle. This is the measure on C\mathbb{C}C given by

12π⋅(λ∣[0,2π))∘Φ−1,Φ(θ)=eiθ,\frac{1}{2\pi}\cdot \bigl(\lambda|_{[0,2\pi)}\bigr)\circ \Phi^{-1}, \qquad \Phi(\theta) = e^{i\theta},2π1​⋅(λ∣[0,2π)​)∘Φ−1,Φ(θ)=eiθ,

where λ∣[0,2π)\lambda|_{[0,2\pi)}λ∣[0,2π)​ is Lebesgue measure restricted to [0,2π)[0,2\pi)[0,2π). That is, it is the image of Lebesgue measure on [0,2π)[0,2\pi)[0,2π) under θ↦eiθ\theta\mapsto e^{i\theta}θ↦eiθ, scaled by 1/(2π)1/(2\pi)1/(2π). Its total mass is 12π⋅2π=1\tfrac{1}{2\pi}\cdot 2\pi = 12π1​⋅2π=1.

IsSymmetricCircleLaw. For a measure μ\muμ on C\mathbb{C}C, the property holds if and only if all three of the following hold:

  1. μ\muμ is a probability measure;
  2. μ({z∈C:∣z∣≠1})=0\mu\bigl(\{z\in\mathbb{C} : |z|\neq 1\}\bigr) = 0μ({z∈C:∣z∣=1})=0;
  3. the image of μ\muμ under z↦−zz\mapsto -zz↦−z equals μ\muμ.

uniformFailureProb. For a finite set of integers JJJ, natural numbers m,sm, sm,s, a measure μ\muμ on C\mathbb{C}C and a property good(T,u)\mathrm{good}(T,u)good(T,u) of a finite set of integers TTT and a vector u∈Csu\in\mathbb{C}^su∈Cs, the value lies in [0,∞][0,\infty][0,∞] and equals

1#{T⊆J:∣T∣=m} ∑T⊆J∣T∣=mμ⊗s({u∈Cs:good(T,u) fails}).\frac{1}{\#\{T\subseteq J : |T|=m\}}\ \sum_{\substack{T\subseteq J\\ |T|=m}} \mu^{\otimes s}\bigl(\{u\in\mathbb{C}^s : \mathrm{good}(T,u)\text{ fails}\}\bigr).#{T⊆J:∣T∣=m}1​ T⊆J∣T∣=m​∑​μ⊗s({u∈Cs:good(T,u) fails}).

Here μ⊗s\mu^{\otimes s}μ⊗s is the sss-fold product measure. Conventions and edge cases:

  • μ\muμ is an arbitrary measure; it is not required to be a probability measure or to live on the unit circle.
  • The sets measured need not be measurable. For a non-measurable set, the value used is the outer measure.
  • If m>∣J∣m>|J|m>∣J∣, the count of mmm-subsets is 000. Its reciprocal is taken to be ∞\infty∞, the sum is empty, and ∞⋅0=0\infty\cdot 0 = 0∞⋅0=0, so the value is 000.
  • For s=0s=0s=0, μ⊗0\mu^{\otimes 0}μ⊗0 is the unit point mass on the single empty vector.
Human review
  • Endorsed by Shuze Chen · Nov 24, 2026

    Confirmed by the moderator at approval.

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