Documentation

CslibFrontier.Foundations.Geometry.Polyhedra.PiecewiseQuadratic

Piecewise-quadratic functions on compact polyhedra #

This file develops real-valued quadratic functions on subsets of real vector spaces and piecewise-quadratic (PQ) functions on compact polyhedra in the style of [RS82].

Main definitions #

Main results #

References #

def Cslib.Polyhedra.IsQuadraticOn {E : Type u_1} [NormedAddCommGroup E] [NormedSpace ℝ E] (f : E → ℝ) (S : Set E) :

A function f : E → ℝ is quadratic on S (meaning a polynomial of total degree at most 2) if it agrees on S with a finite sum of products of pairs of real-valued affine maps.

theorem Cslib.Polyhedra.IsQuadraticOn.congr {E : Type u_1} [NormedAddCommGroup E] [NormedSpace ℝ E] {f f' : E → ℝ} {S : Set E} (hf : IsQuadraticOn f S) (heq : Set.EqOn f' f S) :
theorem Cslib.Polyhedra.IsQuadraticOn.mono {E : Type u_1} [NormedAddCommGroup E] [NormedSpace ℝ E] {f : E → ℝ} {S T : Set E} (hf : IsQuadraticOn f S) (hTS : T ⊆ S) :
theorem Cslib.Polyhedra.IsQuadraticOn.const {E : Type u_1} [NormedAddCommGroup E] [NormedSpace ℝ E] (S : Set E) (c : ℝ) :
IsQuadraticOn (fun (x : E) => c) S
theorem Cslib.Polyhedra.IsQuadraticOn.add {E : Type u_1} [NormedAddCommGroup E] [NormedSpace ℝ E] {f g : E → ℝ} {S : Set E} (hf : IsQuadraticOn f S) (hg : IsQuadraticOn g S) :
IsQuadraticOn (fun (x : E) => f x + g x) S
theorem Cslib.Polyhedra.IsQuadraticOn.neg {E : Type u_1} [NormedAddCommGroup E] [NormedSpace ℝ E] {f : E → ℝ} {S : Set E} (hf : IsQuadraticOn f S) :
IsQuadraticOn (fun (x : E) => -f x) S
theorem Cslib.Polyhedra.IsQuadraticOn.sub {E : Type u_1} [NormedAddCommGroup E] [NormedSpace ℝ E] {f g : E → ℝ} {S : Set E} (hf : IsQuadraticOn f S) (hg : IsQuadraticOn g S) :
IsQuadraticOn (fun (x : E) => f x - g x) S
theorem Cslib.Polyhedra.IsQuadraticOn.smul {E : Type u_1} [NormedAddCommGroup E] [NormedSpace ℝ E] (c : ℝ) {f : E → ℝ} {S : Set E} (hf : IsQuadraticOn f S) :
IsQuadraticOn (fun (x : E) => c * f x) S
theorem Cslib.Polyhedra.IsQuadraticOn.sum {E : Type u_1} [NormedAddCommGroup E] [NormedSpace ℝ E] {ι : Type u_3} (s : Finset ι) {f : ι → E → ℝ} {S : Set E} (hf : ∀ i ∈ s, IsQuadraticOn (f i) S) :
IsQuadraticOn (fun (x : E) => ∑ i ∈ s, f i x) S
theorem Cslib.Polyhedra.IsQuadraticOn.mul_of_isAffineOn {E : Type u_1} [NormedAddCommGroup E] [NormedSpace ℝ E] {f g : E → ℝ} {S : Set E} (hf : IsAffineOn f S) (hg : IsAffineOn g S) :
IsQuadraticOn (fun (x : E) => f x * g x) S
theorem Cslib.Polyhedra.IsQuadraticOn.comp_affineMap {E : Type u_1} {F : Type u_2} [NormedAddCommGroup E] [NormedSpace ℝ E] [NormedAddCommGroup F] [NormedSpace ℝ F] {g : F → ℝ} {T : Set F} (hg : IsQuadraticOn g T) (a : E →ᵃ[ℝ] F) {S : Set E} (hmaps : Set.MapsTo (⇑a) S T) :
IsQuadraticOn (g ∘ ⇑a) S
theorem Cslib.Polyhedra.isQuadraticOn_iff_quadraticMap_add_affineMap {E : Type u_1} [NormedAddCommGroup E] [NormedSpace ℝ E] [FiniteDimensional ℝ E] {f : E → ℝ} {S : Set E} :
IsQuadraticOn f S ↔ ∃ (Q : QuadraticMap ℝ E ℝ) (L : E →ᵃ[ℝ] ℝ), Set.EqOn f (fun (x : E) => Q x + L x) S

On a finite-dimensional real normed space, IsQuadraticOn f S holds if and only if f agrees on S with the sum of a QuadraticMap and an AffineMap.

theorem Cslib.Polyhedra.isQuadraticOn_iff_mvPolynomial_basis {E : Type u_1} [NormedAddCommGroup E] [NormedSpace ℝ E] {ι : Type u_2} [Finite ι] (e : Module.Basis ι ℝ E) {f : E → ℝ} {S : Set E} :
IsQuadraticOn f S ↔ ∃ (p : MvPolynomial ι ℝ), p.totalDegree ≤ 2 ∧ Set.EqOn f (fun (x : E) => (MvPolynomial.eval (e.equivFun x)) p) S

On a finite-dimensional real normed space equipped with a finite basis e, f is quadratic on S if and only if it agrees on S with a multivariate polynomial of totalDegree ≤ 2 in the e-coordinates.

theorem Cslib.Polyhedra.isQuadraticOn_iff_mvPolynomial_pi {d : ℕ} {f : (Fin d → ℝ) → ℝ} {S : Set (Fin d → ℝ)} :
IsQuadraticOn f S ↔ ∃ (p : MvPolynomial (Fin d) ℝ), p.totalDegree ≤ 2 ∧ Set.EqOn f (fun (x : Fin d → ℝ) => (MvPolynomial.eval x) p) S

On Fin d → ℝ, IsQuadraticOn f S is equivalent to agreeing on S with an MvPolynomial (Fin d) ℝ of totalDegree ≤ 2.

def Cslib.Polyhedra.IsPQOn {E : Type u_1} [NormedAddCommGroup E] [NormedSpace ℝ E] (P : Set E) (f : E → ℝ) :

A function f : E → ℝ is piecewise-quadratic on P (IsPQOn P f) if P is a compact polyhedron admitted as the space of a finite polytopal complex on every cell of which f agrees with a polynomial of degree at most 2.

theorem Cslib.Polyhedra.IsPQOn.congr {E : Type u_1} [NormedAddCommGroup E] [NormedSpace ℝ E] {P : Set E} {f f' : E → ℝ} (hf : IsPQOn P f) (heq : Set.EqOn f' f P) :
IsPQOn P f'
theorem Cslib.Polyhedra.IsPQOn.of_isPLOn {E : Type u_1} [NormedAddCommGroup E] [NormedSpace ℝ E] {P : Set E} {f : E → ℝ} (hf : IsPLOn P f) :
IsPQOn P f
theorem Cslib.Polyhedra.IsPQOn.neg {E : Type u_1} [NormedAddCommGroup E] [NormedSpace ℝ E] {P : Set E} {f : E → ℝ} (hf : IsPQOn P f) :
IsPQOn P fun (x : E) => -f x
theorem Cslib.Polyhedra.IsPQOn.smul {E : Type u_1} [NormedAddCommGroup E] [NormedSpace ℝ E] (c : ℝ) {P : Set E} {f : E → ℝ} (hf : IsPQOn P f) :
IsPQOn P fun (x : E) => c * f x
theorem Cslib.Polyhedra.isPQOn_iff_finite_polytope_cover {E : Type u_1} [NormedAddCommGroup E] [NormedSpace ℝ E] [FiniteDimensional ℝ E] {P : Set E} {f : E → ℝ} :
IsPQOn P f ↔ ∃ (ℱ : Set (Set E)), ℱ.Finite ∧ (∀ Q ∈ ℱ, IsPolytope Q ∧ IsQuadraticOn f Q) ∧ P = ⋃ Q ∈ ℱ, Q
theorem Cslib.Polyhedra.IsPQOn.const {E : Type u_1} [NormedAddCommGroup E] [NormedSpace ℝ E] [FiniteDimensional ℝ E] {P : Set E} (hP : IsPolyhedron P) (c : ℝ) :
IsPQOn P fun (x : E) => c
theorem Cslib.Polyhedra.IsPQOn.of_finiteCover {E : Type u_1} [NormedAddCommGroup E] [NormedSpace ℝ E] [FiniteDimensional ℝ E] {ι : Type u_3} [Finite ι] {P : Set E} {Q : ι → Set E} {f : E → ℝ} (hcov : ⋃ (i : ι), Q i = P) (hf : ∀ (i : ι), IsPQOn (Q i) f) :
IsPQOn P f
theorem Cslib.Polyhedra.IsPQOn.piecewise_union {E : Type u_1} [NormedAddCommGroup E] [NormedSpace ℝ E] [FiniteDimensional ℝ E] {P Q : Set E} {f g : E → ℝ} (hf : IsPQOn P f) (hg : IsPQOn Q g) (hagree : ∀ x ∈ P ∩ Q, f x = g x) :
IsPQOn (P ∪ Q) fun (x : E) => if x ∈ P then f x else g x
theorem Cslib.Polyhedra.IsPQOn.restrict {E : Type u_1} [NormedAddCommGroup E] [NormedSpace ℝ E] [FiniteDimensional ℝ E] {P Q : Set E} {f : E → ℝ} (hf : IsPQOn P f) (hQ : IsPolyhedron Q) (hQP : Q ⊆ P) :
IsPQOn Q f
theorem Cslib.Polyhedra.IsPQOn.exists_common_complex {E : Type u_1} [NormedAddCommGroup E] [NormedSpace ℝ E] [FiniteDimensional ℝ E] {P : Set E} {f g : E → ℝ} (hf : IsPQOn P f) (hg : IsPQOn P g) :
∃ (C : PolytopalComplex E), C.space = P ∧ (∀ Q ∈ C.cells, IsQuadraticOn f Q) ∧ ∀ Q ∈ C.cells, IsQuadraticOn g Q
theorem Cslib.Polyhedra.IsPQOn.add {E : Type u_1} [NormedAddCommGroup E] [NormedSpace ℝ E] [FiniteDimensional ℝ E] {P : Set E} {f g : E → ℝ} (hf : IsPQOn P f) (hg : IsPQOn P g) :
IsPQOn P fun (x : E) => f x + g x
theorem Cslib.Polyhedra.IsPQOn.sub {E : Type u_1} [NormedAddCommGroup E] [NormedSpace ℝ E] [FiniteDimensional ℝ E] {P : Set E} {f g : E → ℝ} (hf : IsPQOn P f) (hg : IsPQOn P g) :
IsPQOn P fun (x : E) => f x - g x
theorem Cslib.Polyhedra.IsPQOn.sum {E : Type u_1} [NormedAddCommGroup E] [NormedSpace ℝ E] [FiniteDimensional ℝ E] {ι : Type u_3} (s : Finset ι) {P : Set E} (hP : IsPolyhedron P) {f : ι → E → ℝ} (hf : ∀ i ∈ s, IsPQOn P (f i)) :
IsPQOn P fun (x : E) => ∑ i ∈ s, f i x
theorem Cslib.Polyhedra.IsPQOn.mul_of_isPLOn {E : Type u_1} [NormedAddCommGroup E] [NormedSpace ℝ E] [FiniteDimensional ℝ E] {P : Set E} {f g : E → ℝ} (hf : IsPLOn P f) (hg : IsPLOn P g) :
IsPQOn P fun (x : E) => f x * g x

The pointwise product of two real-valued PL functions on P is PQ on P (cited in issue #4325 notes as STOC 1056 Lemma 3.1, unverified against the primary manuscript).

theorem Cslib.Polyhedra.IsPQOn.sum_mul_of_isPLOn {E : Type u_1} [NormedAddCommGroup E] [NormedSpace ℝ E] [FiniteDimensional ℝ E] {ι : Type u_3} (s : Finset ι) {P : Set E} (hP : IsPolyhedron P) {f g : ι → E → ℝ} (hf : ∀ i ∈ s, IsPLOn P (f i)) (hg : ∀ i ∈ s, IsPLOn P (g i)) :
IsPQOn P fun (x : E) => ∑ i ∈ s, f i x * g i x

Any finite sum of pairwise products of real-valued PL functions on P is PQ on P.

theorem Cslib.Polyhedra.IsPQOn.comp_isPLOn {E : Type u_1} {F : Type u_2} [NormedAddCommGroup E] [NormedSpace ℝ E] [FiniteDimensional ℝ E] [NormedAddCommGroup F] [NormedSpace ℝ F] [FiniteDimensional ℝ F] {P : Set E} {T : Set F} {f : E → F} {g : F → ℝ} (hf : IsPLOn P f) (hg : IsPQOn T g) (hmaps : Set.MapsTo f P T) :
IsPQOn P (g ∘ f)

Precomposing a PQ map with a PL map preserves piecewise-quadraticity.

theorem Cslib.Polyhedra.IsPQOn.exists_triangulation_mvPolynomial_basis {E : Type u_1} [NormedAddCommGroup E] [NormedSpace ℝ E] [FiniteDimensional ℝ E] {ι : Type u_3} [Finite ι] (e : Module.Basis ι ℝ E) {P : Set E} {f : E → ℝ} (hf : IsPQOn P f) :
∃ (K : Geometry.SimplicialComplex ℝ E), K.faces.Finite ∧ K.space = P ∧ ∃ (p : Finset E → MvPolynomial ι ℝ), ∀ s ∈ K.faces, (p s).totalDegree ≤ 2 ∧ Set.EqOn f (fun (x : E) => (MvPolynomial.eval (e.equivFun x)) (p s)) ((convexHull ℝ) ↑s)

Every PQ function admits a finite triangulation on each simplex of which it agrees with an MvPolynomial of totalDegree ≤ 2 in the coordinates of a given basis e.

theorem Cslib.Polyhedra.IsPQOn.exists_triangulation_mvPolynomial_pi {d : ℕ} {P : Set (Fin d → ℝ)} {f : (Fin d → ℝ) → ℝ} (hf : IsPQOn P f) :
∃ (K : Geometry.SimplicialComplex ℝ (Fin d → ℝ)), K.faces.Finite ∧ K.space = P ∧ ∃ (p : Finset (Fin d → ℝ) → MvPolynomial (Fin d) ℝ), ∀ s ∈ K.faces, (p s).totalDegree ≤ 2 ∧ Set.EqOn f (fun (x : Fin d → ℝ) => (MvPolynomial.eval x) (p s)) ((convexHull ℝ) ↑s)

Specialization of IsPQOn.exists_triangulation_mvPolynomial_basis to Fin d → ℝ.

theorem Cslib.Polyhedra.IsPQOn.exists_cell_list_mvPolynomial_basis {E : Type u_1} [NormedAddCommGroup E] [NormedSpace ℝ E] [FiniteDimensional ℝ E] {ι : Type u_3} [Finite ι] (e : Module.Basis ι ℝ E) {P : Set E} {f : E → ℝ} (hf : IsPQOn P f) :
∃ (L : List (Set E × MvPolynomial ι ℝ)), (∀ (S : Set E) (p : MvPolynomial ι ℝ), (S, p) ∈ L → IsPolytope S ∧ p.totalDegree ≤ 2 ∧ Set.EqOn f (fun (x : E) => (MvPolynomial.eval (e.equivFun x)) p) S) ∧ ⋃ S ∈ List.map Prod.fst L, S = P

Every PQ function on P can be presented as a finite list of convex polytope cells covering P together with a multivariate polynomial of totalDegree ≤ 2 (in coordinates of basis e) matching f on each cell.

theorem Cslib.Polyhedra.IsPQOn.exists_cell_list_mvPolynomial_pi {d : ℕ} {P : Set (Fin d → ℝ)} {f : (Fin d → ℝ) → ℝ} (hf : IsPQOn P f) :
∃ (L : List (Set (Fin d → ℝ) × MvPolynomial (Fin d) ℝ)), (∀ (S : Set (Fin d → ℝ)) (p : MvPolynomial (Fin d) ℝ), (S, p) ∈ L → IsPolytope S ∧ p.totalDegree ≤ 2 ∧ Set.EqOn f (fun (x : Fin d → ℝ) => (MvPolynomial.eval x) p) S) ∧ ⋃ S ∈ List.map Prod.fst L, S = P

On Fin d → ℝ, every PQ function on P admits a finite list of convex polytope cells covering P on each of which f agrees with an MvPolynomial (Fin d) ℝ of totalDegree ≤ 2.

theorem Cslib.Polyhedra.IsPQOn.exists_cell_list_quadraticMap {E : Type u_1} [NormedAddCommGroup E] [NormedSpace ℝ E] [FiniteDimensional ℝ E] {P : Set E} {f : E → ℝ} (hf : IsPQOn P f) :
∃ (L : List (Set E × QuadraticMap ℝ E ℝ × (E →ᵃ[ℝ] ℝ))), (∀ (S : Set E) (Q : QuadraticMap ℝ E ℝ) (L' : E →ᵃ[ℝ] ℝ), (S, Q, L') ∈ L → IsPolytope S ∧ Set.EqOn f (fun (x : E) => Q x + L' x) S) ∧ ⋃ S ∈ List.map Prod.fst L, S = P

Coordinate-free finite cell list for a PQ function: a finite list of polytopes covering P together with pairs (Q, L) of a QuadraticMap and an AffineMap agreeing with f on each cell.