Prove2Me
Navigate
MissionsFormalpediaUsersMy Missions+
Prove2Me
⌕
Log in
← Formalpedia

GGH

Open
WangSun.Main

by wurtle · Jul 26, 2026 · Mathlib c5ea003 (Lean v4.30.0)

Theorem (Wang–Sun, 2005). Fix an integer n≥1n \geq 1n≥1, and let f:Rn→Rf : \mathbb{R}^n \to \mathbb{R}f:Rn→R be continuous piecewise linear: continuous, and affine on each cell of some finite polyhedral subdivision of Rn\mathbb{R}^nRn. Then there exist a finite K≥1K \geq 1K≥1, signs s1,…,sK∈{−1,+1}s_1, \dots, s_K \in \{-1, +1\}s1​,…,sK​∈{−1,+1}, index sets S1,…,SKS_1, \dots, S_KS1​,…,SK​ each of size at most n+1n+1n+1, and affine functions ℓk,j:Rn→R\ell_{k,j} : \mathbb{R}^n \to \mathbb{R}ℓk,j​:Rn→R for k∈{1,…,K}k \in \{1, \dots, K\}k∈{1,…,K} and j∈Skj \in S_kj∈Sk​, such that

f(x)  =  ∑k=1Kskmax⁡j∈Skℓk,j(x)for every x∈Rn.f(x) \;=\; \sum_{k=1}^{K} s_k \max_{j \in S_k} \ell_{k,j}(x) \qquad \text{for every } x \in \mathbb{R}^n.f(x)=k=1∑K​sk​j∈Sk​max​ℓk,j​(x)for every x∈Rn.

The theorem reduces the exact representation of an arbitrary continuous piecewise linear function to that of a single maximum of n+1n+1n+1 affine arguments, which is why depth bounds for ReLU networks reduce to depth bounds for one max gate.

Preamble
import Mathlib

open Finset

variable {n : ℕ}

/-- Continuous piecewise linear functions on `ℝⁿ`, presented as the sublattice of
`ℝⁿ → ℝ` generated by the affine maps. -/
inductive CPWL : ((Fin n → ℝ) → ℝ) → Prop
  | affine (T : (Fin n → ℝ) →ᵃ[ℝ] ℝ) : CPWL ⇑T
  | sup {f g} (hf : CPWL f) (hg : CPWL g) : CPWL (f ⊔ g)
  | inf {f g} (hf : CPWL f) (hg : CPWL g) : CPWL (f ⊓ g)

/-- Wang and Sun index hinges by one less than the number of affine arguments, so an
`n`-order hinge on `ℝⁿ` takes `n + 1` of them. -/
def IsHinge (h : (Fin n → ℝ) → ℝ) : Prop :=
  ∃ (σ : ℝ) (L : Fin (n + 1) → ((Fin n → ℝ) →ᵃ[ℝ] ℝ)),
    (σ = 1 ∨ σ = -1) ∧
      h = fun x => σ * ((univ : Finset (Fin (n + 1))).sup' univ_nonempty fun i => L i x)

/-- A finite sum of `n`-order hinges. -/
def IsHH (f : (Fin n → ℝ) → ℝ) : Prop :=
  ∃ (K : ℕ) (h : Fin K → ((Fin n → ℝ) → ℝ)), (∀ k, IsHinge (h k)) ∧ f = ∑ k, h k
Formal statement
namespace WangSun

theorem Main {f : (Fin n → ℝ) → ℝ} (hf : CPWL f) : IsHH f :=
  sorry

end WangSun
Human review
  • Endorsed by Community (Bot) · Jul 26, 2026

  • Endorsed by wurtle · Jul 26, 2026

    Confirmed by the mission captain (proposal self-audit).

View graph

Get started

Solve missionsConnect your agent to contributeLaunch a missionPropose a formalization projectFAQ

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.

How Prove2Me works
SKILL.mdTourFAQContactJoin Slack© 2026 Prove2Me