Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Sparsity in levels and the weighted rNSP in levels (Defs. 1.6–1.7)

Definition
Def_CAH21_SparsityInLevels

by LG · Sep 30, 2026 · Mathlib 0df444a (Lean v4.33.1)

compressed-sensingsparsity

Sparsity in levels and the weighted robust null space property in levels (SI Appendix, Definitions 1.6 and 1.7).

Let M=(M1,…,Mr)M=(M_1,\dots,M_r)M=(M1​,…,Mr​) with 1≤M1<⋯<Mr=N1\le M_1<\dots<M_r=N1≤M1​<⋯<Mr​=N and M0=0M_0=0M0​=0, and let s=(s1,…,sr)s=(s_1,\dots,s_r)s=(s1​,…,sr​) with 0<sk≤Mk−Mk−10<s_k\le M_k-M_{k-1}0<sk​≤Mk​−Mk−1​. Level kkk is the block of coordinates {Mk−1+1,…,Mk}\{M_{k-1}+1,\dots,M_k\}{Mk−1​+1,…,Mk​}. A vector x∈CNx\in\mathbb C^Nx∈CN is (s,M)(s,M)(s,M)-sparse in levels if it has at most sks_ksk​ nonzero entries in level kkk for every kkk; a set Δ\DeltaΔ of coordinates is an (s,M)(s,M)(s,M) support set if it has at most sks_ksk​ elements in level kkk. Weights wi>0w_i>0wi​>0 are constant on levels, wi=w(k)w_i=w_{(k)}wi​=w(k)​ for iii in level kkk (assumption (1.15)). Define

∥x∥lw1=∑iwi∣xi∣,σs,M(x)lw1=inf⁡{∥x−z∥lw1:z∈Σs,M},\|x\|_{l^1_w}=\sum_{i}w_i|x_i|,\qquad \sigma_{s,M}(x)_{l^1_w}=\inf\{\|x-z\|_{l^1_w}: z\in\Sigma_{s,M}\},∥x∥lw1​​=i∑​wi​∣xi​∣,σs,M​(x)lw1​​=inf{∥x−z∥lw1​​:z∈Σs,M​}, ξ=∑k=1rw(k)2sk,ζ=min⁡kw(k)2sk,κ=ξ/ζ.\xi=\sum_{k=1}^r w_{(k)}^2 s_k,\qquad \zeta=\min_{k} w_{(k)}^2 s_k,\qquad \kappa=\xi/\zeta .ξ=k=1∑r​w(k)2​sk​,ζ=kmin​w(k)2​sk​,κ=ξ/ζ.

A matrix A∈Cm×NA\in\mathbb C^{m\times N}A∈Cm×N has the weighted rNSP in levels of order (s,M)(s,M)(s,M) with constants 0<ρ<10<\rho<10<ρ<1, γ>0\gamma>0γ>0 if for every (s,M)(s,M)(s,M) support set Δ\DeltaΔ,

∥xΔ∥l2≤ρ ∥xΔc∥lw1ξ+γ∥Ax∥l2for all x∈CN.\|x_\Delta\|_{l^2}\le \frac{\rho\,\|x_{\Delta^c}\|_{l^1_w}}{\sqrt\xi}+\gamma\|Ax\|_{l^2}\qquad\text{for all }x\in\mathbb C^N.∥xΔ​∥l2​≤ξ​ρ∥xΔc​∥lw1​​​+γ∥Ax∥l2​for all x∈CN.

The file also defines the Euclidean norm, the spectral norm ∥A∥=sup⁡∥x∥l2≤1∥Ax∥l2\|A\|=\sup_{\|x\|_{l^2}\le1}\|Ax\|_{l^2}∥A∥=sup∥x∥l2​≤1​∥Ax∥l2​, and the constants C1=(1+ρ2+(3+ρ)κ1/44)3+ρ1−ρC_1=\big(\tfrac{1+\rho}{2}+\tfrac{(3+\rho)\kappa^{1/4}}{4}\big)\tfrac{3+\rho}{1-\rho}C1​=(21+ρ​+4(3+ρ)κ1/4​)1−ρ3+ρ​ and C2=2(3+ρ1−ρ+7+ρ1−ρκ1/42)γC_2=2\big(\tfrac{3+\rho}{1-\rho}+\tfrac{7+\rho}{1-\rho}\tfrac{\kappa^{1/4}}{2}\big)\gammaC2​=2(1−ρ3+ρ​+1−ρ7+ρ​2κ1/4​)γ of Theorem 3.

These definitions are the shared model for every statement of the mission.

Formalization Note Coordinates are numbered from 000, so level kkk is {i:Mk−1≤i<Mk}\{i: M_{k-1}\le i<M_k\}{i:Mk−1​≤i<Mk​}; the sequences M,s,w(⋅)M,s,w_{(\cdot)}M,s,w(⋅)​ are indexed by N\mathbb NN and only indices 0,…,r0,\dots,r0,…,r are used. The standing assumptions (including r≥1r\ge1r≥1 and (1.15)) are bundled in the predicate LevelData.Valid. The rNSPL predicate includes the constraints 0<ρ<10<\rho<10<ρ<1, γ>0\gamma>0γ>0.

Definition code
import Mathlib

/-!
Colbrook–Antun–Hansen (PNAS 2022, arXiv:2101.08286v2), SI Appendix §1.2.2:
sparsity in levels (Definition 1.6), the quantities `ξ, ζ, κ` and the weighted
robust null space property in levels (Definition 1.7).

Conventions: coordinates of `ℂ^N` are indexed by `Fin N` starting at `0`, so the
paper's level `{M_{k-1}+1, …, M_k}` is `{i : M (k-1) ≤ i < M k}`. Levels are
indexed by `k = 1, …, r` and the sequences `M, s, wl` are indexed by `ℕ`, with
`M 0 = 0` (the paper's convention `M_0 = 0`); values at indices outside
`0, …, r` are never used.
-/

namespace ColbrookAntunHansen

open Finset

/-- Sparsity-in-levels data: number of levels `r`, level boundaries `M`,
local sparsities `s`, coordinate weights `w` and level weights `wl`
(the paper's `w_{(k)}`). -/
structure LevelData (N : ℕ) where
  r : ℕ
  M : ℕ → ℕ
  s : ℕ → ℕ
  w : Fin N → ℝ
  wl : ℕ → ℝ

namespace LevelData

variable {N : ℕ} (L : LevelData N)

/-- Coordinate `i` lies in the `k`-th level `{M_{k-1}+1, …, M_k}` (0-indexed). -/
def InLevel (k : ℕ) (i : Fin N) : Prop := L.M (k - 1) ≤ i.val ∧ i.val < L.M k

instance (k : ℕ) : DecidablePred (L.InLevel k) := fun i => by
  unfold InLevel; infer_instance

/-- The standing assumptions of Definition 1.6 and of SI §1.2.2:
`M_0 = 0`, `1 ≤ M_1 < ⋯ < M_r = N` (with `r ≥ 1`), `0 < s_k ≤ M_k - M_{k-1}`,
positive weights, and (1.15): `w_i = w_{(k)}` whenever `i` is in level `k`. -/
def Valid : Prop :=
  1 ≤ L.r ∧ L.M 0 = 0 ∧ (∀ k, 1 ≤ k → k ≤ L.r → L.M (k - 1) < L.M k) ∧ L.M L.r = N ∧
  (∀ k, 1 ≤ k → k ≤ L.r → 0 < L.s k ∧ L.s k ≤ L.M k - L.M (k - 1)) ∧
  (∀ i, 0 < L.w i) ∧
  (∀ k, 1 ≤ k → k ≤ L.r → ∀ i, L.InLevel k i → L.w i = L.wl k)

/-- `Δ ⊆ {1,…,N}` is an `(s, M)` support set: it has at most `s_k` elements in level `k`. -/
def IsSupportSet (Δ : Finset (Fin N)) : Prop :=
  ∀ k, 1 ≤ k → k ≤ L.r → (Δ.filter (L.InLevel k)).card ≤ L.s k

/-- `x` is `(s, M)`-sparse in levels, i.e. `x ∈ Σ_{s,M}`. -/
def IsSparse (x : Fin N → ℂ) : Prop :=
  ∀ k, 1 ≤ k → k ≤ L.r →
    ((Finset.univ.filter (fun i => x i ≠ 0)).filter (L.InLevel k)).card ≤ L.s k

/-- `ξ = ∑_{k=1}^r w_{(k)}^2 s_k`. -/
def xi : ℝ := ∑ k ∈ Finset.Icc 1 L.r, L.wl k ^ 2 * (L.s k : ℝ)

/-- `ζ = min_{k=1,…,r} w_{(k)}^2 s_k`. -/
noncomputable def zeta : ℝ := ⨅ k : Finset.Icc 1 L.r, L.wl k ^ 2 * (L.s k : ℝ)

/-- `κ = ξ / ζ`. -/
noncomputable def kappa : ℝ := L.xi / L.zeta

/-- `min_{k=1,…,r} w_{(k)}`. -/
noncomputable def minWeight : ℝ := ⨅ k : Finset.Icc 1 L.r, L.wl k

end LevelData

/-- Euclidean norm `‖x‖_{l^2}`. -/
noncomputable def l2norm {n : ℕ} (x : Fin n → ℂ) : ℝ := Real.sqrt (∑ i, ‖x i‖ ^ 2)

/-- Weighted `l^1` norm `‖x‖_{l^1_w} = ∑ w_i |x_i|`. -/
noncomputable def wl1norm {N : ℕ} (w : Fin N → ℝ) (x : Fin N → ℂ) : ℝ := ∑ i, w i * ‖x i‖

/-- Projection `P_Δ x` (keep the coordinates in `Δ`, zero the others). -/
def restrict {N : ℕ} (Δ : Finset (Fin N)) (x : Fin N → ℂ) : Fin N → ℂ :=
  fun i => if i ∈ Δ then x i else 0

/-- Euclidean operator norm `‖A‖ = sup {‖A x‖_{l^2} : ‖x‖_{l^2} ≤ 1}`. -/
noncomputable def opNorm {m N : ℕ} (A : Matrix (Fin m) (Fin N) ℂ) : ℝ :=
  sSup ((fun x => l2norm (A.mulVec x)) '' {x | l2norm x ≤ 1})

/-- `σ_{s,M}(x)_{l^1_w} = inf {‖x - z‖_{l^1_w} : z ∈ Σ_{s,M}}`. -/
noncomputable def sigmaSM {N : ℕ} (L : LevelData N) (x : Fin N → ℂ) : ℝ :=
  sInf ((fun z => wl1norm L.w (x - z)) '' {z | L.IsSparse z})

/-- Definition 1.7: `A` has the weighted rNSP in levels of order `(s, M)` with constants
`0 < ρ < 1`, `γ > 0`: for every `(s, M)` support set `Δ` and every `x ∈ ℂ^N`,
`‖x_Δ‖_{l^2} ≤ ρ ‖x_{Δᶜ}‖_{l^1_w} / √ξ + γ ‖A x‖_{l^2}`. -/
def WeightedRNSPL {m N : ℕ} (A : Matrix (Fin m) (Fin N) ℂ) (L : LevelData N) (ρ γ : ℝ) : Prop :=
  0 < ρ ∧ ρ < 1 ∧ 0 < γ ∧
  ∀ Δ : Finset (Fin N), L.IsSupportSet Δ → ∀ x : Fin N → ℂ,
    l2norm (restrict Δ x) ≤ ρ * wl1norm L.w (restrict Δᶜ x) / Real.sqrt L.xi + γ * l2norm (A.mulVec x)

/-- The constant `C₁ = ((1+ρ)/2 + (3+ρ) κ^{1/4}/4) · (3+ρ)/(1-ρ)` of Theorem 3. -/
noncomputable def constC1 (ρ κ : ℝ) : ℝ :=
  ((1 + ρ) / 2 + (3 + ρ) * κ ^ ((1 : ℝ) / 4) / 4) * ((3 + ρ) / (1 - ρ))

/-- The constant `C₂ = 2 ((3+ρ)/(1-ρ) + (7+ρ)/(1-ρ) · κ^{1/4}/2) γ` of Theorem 3. -/
noncomputable def constC2 (ρ κ γ : ℝ) : ℝ :=
  2 * ((3 + ρ) / (1 - ρ) + (7 + ρ) / (1 - ρ) * (κ ^ ((1 : ℝ) / 4) / 2)) * γ

end ColbrookAntunHansen
Source
Colbrook, Antun, Hansen, Can stable and accurate neural networks be computed? On the barriers of deep learning and Smale's 18th problem, arXiv:2101.08286v2 (PNAS 119(12), 2022), https://arxiv.org/abs/2101.08286, SI Appendix, p. 5, Definitions 1.6 and 1.7, assumption (1.15); constants C1, C2 from Theorem 3 (p. 6)
Read-back

What the Lean code literally says, in plain math · Aristotle (Harmonic) — same agent that drafted the statements (non-blind)

Non-blind read-back. This read-back was written by the same agent (Aristotle, by Harmonic) that drafted the Lean statements, at the proposal owner's explicit request. It is not independent, blind testimony: its author knew the source paper and the intended meaning while writing it. Reviewers should treat it as the drafter's own reading of the code, not as an independent audit, and should compare the Lean code against the source themselves.

This file introduces the following objects (everything lives in the namespace ColbrookAntunHansen).

Level data. A record LLL over a dimension N∈NN\in\mathbb NN∈N consists of a natural number rrr, sequences M=(Mk)k∈NM=(M_k)_{k\in\mathbb N}M=(Mk​)k∈N​ and s=(sk)k∈Ns=(s_k)_{k\in\mathbb N}s=(sk​)k∈N​ of natural numbers, a coordinate weight vector w=(wi)i∈{0,…,N−1}w=(w_i)_{i\in\{0,\dots,N-1\}}w=(wi​)i∈{0,…,N−1}​ of reals, and a real sequence (w(k))k∈N(w_{(k)})_{k\in\mathbb N}(w(k)​)k∈N​ of level weights. Coordinates are numbered 0,…,N−10,\dots,N-10,…,N−1. Coordinate iii is in level kkk iff

Mk−1≤i<Mk,M_{k-1}\le i<M_k,Mk−1​≤i<Mk​,

where k−1k-1k−1 is natural-number subtraction (so for k=0k=0k=0 this reads M0≤i<M0M_0\le i<M_0M0​≤i<M0​, which is empty).

Validity of LLL means all of:

  1. r≥1r\ge 1r≥1;
  2. M0=0M_0=0M0​=0;
  3. Mk−1<MkM_{k-1}<M_kMk−1​<Mk​ for 1≤k≤r1\le k\le r1≤k≤r;
  4. Mr=NM_r=NMr​=N;
  5. 0<sk≤Mk−Mk−10<s_k\le M_k-M_{k-1}0<sk​≤Mk​−Mk−1​ for 1≤k≤r1\le k\le r1≤k≤r (natural-number subtraction, harmless here by 3);
  6. wi>0w_i>0wi​>0 for every coordinate iii;
  7. for 1≤k≤r1\le k\le r1≤k≤r and every iii in level kkk, wi=w(k)w_i=w_{(k)}wi​=w(k)​.

Values Mk,sk,w(k)M_k,s_k,w_{(k)}Mk​,sk​,w(k)​ for k>rk>rk>r play no role in validity. Validity forces N≥1N\ge 1N≥1 and implies that every coordinate lies in exactly one level k∈{1,…,r}k\in\{1,\dots,r\}k∈{1,…,r}.

Support sets and sparsity. A finite set Δ⊆{0,…,N−1}\Delta\subseteq\{0,\dots,N-1\}Δ⊆{0,…,N−1} is an (s,M)(s,M)(s,M) support set iff ∣{i∈Δ:i in level k}∣≤sk|\{i\in\Delta: i \text{ in level } k\}|\le s_k∣{i∈Δ:i in level k}∣≤sk​ for every 1≤k≤r1\le k\le r1≤k≤r. A vector x∈CNx\in\mathbb C^Nx∈CN is (s,M)(s,M)(s,M)-sparse iff the set {i:xi≠0}\{i: x_i\ne 0\}{i:xi​=0} is an (s,M)(s,M)(s,M) support set (written out: at most sks_ksk​ nonzero entries in each level kkk, 1≤k≤r1\le k\le r1≤k≤r).

Numbers attached to LLL.

ξ=∑k=1rw(k)2sk,ζ=inf⁡1≤k≤rw(k)2sk,κ=ξ/ζ,wmin⁡=inf⁡1≤k≤rw(k).\xi=\sum_{k=1}^r w_{(k)}^2 s_k,\qquad \zeta=\inf_{1\le k\le r} w_{(k)}^2 s_k,\qquad \kappa=\xi/\zeta,\qquad w_{\min}=\inf_{1\le k\le r} w_{(k)}.ξ=k=1∑r​w(k)2​sk​,ζ=1≤k≤rinf​w(k)2​sk​,κ=ξ/ζ,wmin​=1≤k≤rinf​w(k)​.

The infima are over the finite index set {1,…,r}\{1,\dots,r\}{1,…,r} (real-number infimum; if r=0r=0r=0 they would be the junk value 000, and division by 000 is 000, but validity excludes r=0r=0r=0).

Norms and projections. For x∈Cnx\in\mathbb C^nx∈Cn: ∥x∥2=∑i∣xi∣2\|x\|_{2}=\sqrt{\sum_i |x_i|^2}∥x∥2​=∑i​∣xi​∣2​. For weights www: ∥x∥1,w=∑iwi∣xi∣\|x\|_{1,w}=\sum_i w_i|x_i|∥x∥1,w​=∑i​wi​∣xi​∣ (no positivity is built into this definition). For Δ\DeltaΔ a set of coordinates, PΔxP_\Delta xPΔ​x keeps the entries with index in Δ\DeltaΔ and replaces the others by 000. For a complex m×Nm\times Nm×N matrix AAA,

∥A∥=sup⁡{∥Ax∥2: x∈CN, ∥x∥2≤1}\|A\|=\sup\{\|Ax\|_2:\ x\in\mathbb C^N,\ \|x\|_2\le 1\}∥A∥=sup{∥Ax∥2​: x∈CN, ∥x∥2​≤1}

(real supremum of a set of reals; this set is nonempty and bounded, so this is the usual spectral norm).

Best sparse approximation error.

σs,M(x)1,w=inf⁡{∥x−z∥1,w: z (s,M)-sparse}\sigma_{s,M}(x)_{1,w}=\inf\{\|x-z\|_{1,w}:\ z\ (s,M)\text{-sparse}\}σs,M​(x)1,w​=inf{∥x−z∥1,w​: z (s,M)-sparse}

(real infimum; the set is nonempty since z=0z=0z=0 is sparse).

Weighted rNSP in levels. A complex m×Nm\times Nm×N matrix AAA satisfies it with constants (ρ,γ)(\rho,\gamma)(ρ,γ) iff 0<ρ<10<\rho<10<ρ<1, γ>0\gamma>0γ>0, and for every (s,M)(s,M)(s,M) support set Δ\DeltaΔ and every x∈CNx\in\mathbb C^Nx∈CN,

∥PΔx∥2 ≤ ρ ∥PΔcx∥1,wξ+γ∥Ax∥2.\|P_\Delta x\|_2\ \le\ \frac{\rho\,\|P_{\Delta^c}x\|_{1,w}}{\sqrt{\xi}}+\gamma\|Ax\|_2 .∥PΔ​x∥2​ ≤ ξ​ρ∥PΔc​x∥1,w​​+γ∥Ax∥2​.

Here ⋅\sqrt{\cdot}⋅​ is the real square root (equal to 000 on negative inputs; ξ>0\xi>0ξ>0 under validity).

Constants. For reals ρ,κ,γ\rho,\kappa,\gammaρ,κ,γ (with κ1/4\kappa^{1/4}κ1/4 the real power, meaningful for κ≥0\kappa\ge 0κ≥0):

C1(ρ,κ)=(1+ρ2+(3+ρ)κ1/44)3+ρ1−ρ,C2(ρ,κ,γ)=2(3+ρ1−ρ+7+ρ1−ρ⋅κ1/42)γ.C_1(\rho,\kappa)=\Big(\frac{1+\rho}{2}+\frac{(3+\rho)\kappa^{1/4}}{4}\Big)\frac{3+\rho}{1-\rho},\qquad C_2(\rho,\kappa,\gamma)=2\Big(\frac{3+\rho}{1-\rho}+\frac{7+\rho}{1-\rho}\cdot\frac{\kappa^{1/4}}{2}\Big)\gamma .C1​(ρ,κ)=(21+ρ​+4(3+ρ)κ1/4​)1−ρ3+ρ​,C2​(ρ,κ,γ)=2(1−ρ3+ρ​+1−ρ7+ρ​⋅2κ1/4​)γ.

(No hypotheses are attached; at ρ=1\rho=1ρ=1 the divisions return 000.)

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