Finite inequality violation and quadratic penalty
DefinitionVectorSpaceOpt_quadratic_penaltyFor a finite constraint vector z : Fin p → ℝ, positivePartVector z has component max 0 (z i). Given G : X → Fin p → ℝ, the scalar violation and feasibility predicates are
The quadratic exterior-penalty objective at weight K is f x + K * v x. These definitions exactly encode Luenberger's G⁺(x)·G⁺(x) for finite inequality systems and provide a reusable, nonnegative real-valued residual. They do not assume continuity, differentiability, convexity, or a norm on the decision type, allowing the algebraic estimates and later topological cluster-point arguments to share one interface.
import Mathlib
open scoped BigOperators
namespace VectorSpaceOpt
/-- The componentwise positive part used to encode inequality violations. -/
def positivePartVector {p : ℕ} (z : Fin p → ℝ) : Fin p → ℝ :=
fun i => max 0 (z i)
/-- The squared Euclidean violation of the inequalities `G x ≤ 0`. -/
def constraintViolation {X : Type*} {p : ℕ} (G : X → Fin p → ℝ) (x : X) : ℝ :=
∑ i, (positivePartVector (G x) i) ^ 2
/-- Feasibility for a finite family of scalar inequality constraints. -/
def IsConstraintFeasible {X : Type*} {p : ℕ} (G : X → Fin p → ℝ) (x : X) : Prop :=
∀ i, G x i ≤ 0
/-- The quadratic exterior-penalty objective `f(x) + K ‖G⁺(x)‖²`. -/
def quadraticPenaltyObjective {X : Type*} {p : ℕ}
(f : X → ℝ) (G : X → Fin p → ℝ) (K : ℝ) (x : X) : ℝ :=
f x + K * constraintViolation G x
end VectorSpaceOptRead-back
What the Lean code literally says, in plain math · gpt-5
positivePartVector. For any natural and vector , this is the vector whose th component is . When it is the unique function on the empty index type.
constraintViolation. For any type , natural , constraint map , and , this is the finite sum . It is always nonnegative; for the empty sum is for every .
IsConstraintFeasible. For such and , feasibility means for every . For this universal statement is vacuous, so every is feasible.
quadraticPenaltyObjective. For arbitrary , , real , and , the value is . The definition allows any real , including zero and negative values; positivity is imposed only by theorem hypotheses that explicitly state it.
Confirmed by the mission captain (proposal self-audit).