Continuous piecewise linear functions, -order hinges, and hinging-hyperplane sums
DefinitionWangSunCPWLFix a dimension and work with real-valued functions on , identified with Fin n → ℝ. This file sets up the three notions used by the Wang–Sun representation theorem for continuous piecewise linear functions.
Continuous piecewise linear functions. CPWL is defined inductively as the sublattice of generated by the affine maps: every affine is CPWL, and the class is closed under the pointwise operations and . This lattice-theoretic presentation is equivalent to the usual geometric one — continuous and affine on each cell of a finite polyhedral subdivision of — and it is the presentation that makes structural induction available.
-order hinges. Following Wang and Sun, a hinge is indexed by one less than its number of affine arguments, so an -order hinge on takes of them: IsHinge h holds when there are a sign and affine maps with
Hinging hyperplane sums. IsHH f holds when is a finite sum of -order hinges. The Wang–Sun theorem asserts that every CPWL function is an IsHH function; these definitions are the vocabulary in which that theorem and its supporting lemmas are stated.
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