Papers
Topics
Authors
Recent
Search
2000 character limit reached

Convexifying Butterfly Functions

Updated 4 January 2026
  • Butterfly-shaped functions are bivariate, piecewise quadratic maps defined by four wing patches, illustrating nonconvexity that requires convex envelopes for optimization.
  • Convex envelope computation uses polyhedral subdivision and Fenchel duality to derive piecewise rational approximations, ensuring global convexity across regions.
  • QP-based convex surrogate fitting efficiently approximates the convex envelope from sample data, guaranteeing optimality and reproducibility in analysis.

A butterfly-shaped function refers to a prototypical bivariate surface exhibiting nonconvexity and piecewise structure, often modeled as multiple quadratic patches meeting along diagonals. Convexifying such functions—explicitly constructing their convex envelopes or fitting convex surrogates—is fundamental in convex analysis, optimization, and convex regression. The canonical butterfly map provides a benchmark example for techniques bridging nonconvex surfaces with convex programmatic representations in both symbolic and numeric settings.

1. Butterfly-Shaped Functions: Structure and Modeling

Butterfly-shaped functions typically arise as bivariate, piecewise quadratic surfaces segmented into four "wing" patches meeting along two diagonals. Mathematically, each patch is defined as

fi(x)=12x⊤Qix+ci⊤x+di,x∈Pi⊂R2,f_i(x) = \frac{1}{2}x^\top Q_i x + c_i^\top x + d_i, \quad x \in P_i \subset \mathbb{R}^2,

where QiQ_i may be indefinite, ci∈R2c_i \in \mathbb{R}^2, di∈Rd_i \in \mathbb{R}, and PiP_i is a region (e.g., triangle or trapezoid) in the plane (Kumar et al., 2021). The butterfly form exemplifies piecewise quadratic maps with contour discontinuities at the region boundaries, producing nonconvexity not only locally due to the indefinite QiQ_i, but also globally due to the stitched structure.

Such functions serve as illustrative testbeds for convex analysis methods as they encompass both smooth and nonsmooth behaviors, enforce exact geometry at vertices and edges, and reveal the challenges of convex envelope computation and surrogate fitting (Kumar et al., 2021, Schaller et al., 4 Jun 2025).

2. Convex Envelope Computation via Polyhedral Subdivision

The closed convex envelope env f\mathrm{env}\,f of a butterfly-shaped map is the maximal convex underestimator. For each quadratic patch, if QiQ_i is positive semidefinite, the envelope coincides with fif_i everywhere. For indefinite QiQ_i, one must:

  • Apply a linear change of variables so QiQ_i0 is expressed in mixed form (bilinear QiQ_i1 plus affine),
  • Identify "McCormick-lines"—critical lines segmenting the region along which the bilinear nonconvexity is maximal,
  • Subdivide QiQ_i2 into subpolygons QiQ_i3 along these lines (Kumar et al., 2021).

Within each QiQ_i4, the convex envelope is written as

QiQ_i5

with coefficients derived via supporting planes and convexity constraints. The envelope is always below QiQ_i6, is piecewise rational, and its level sets are linearly ruled. The graph is QiQ_i7 but not typically QiQ_i8 across region boundaries; for the butterfly wing example, exactly three subtriangles arise per patch, each admitting such an explicit formula (Kumar et al., 2021).

3. Biconjugation: Fenchel Analysis and Explicit Envelope Recovery

Convexification by biconjugation leverages Fenchel duality:

  1. Compute the Fenchel conjugate QiQ_i9 for each rational envelope on ci∈R2c_i \in \mathbb{R}^20:

    • Vertex regions: ci∈R2c_i \in \mathbb{R}^21 is affine, valid in normal cones at vertices.
    • Edge regions: ci∈R2c_i \in \mathbb{R}^22 admits a rational-over-square-root format,

    ci∈R2c_i \in \mathbb{R}^23

    where ci∈R2c_i \in \mathbb{R}^24, ci∈R2c_i \in \mathbb{R}^25 are explicit affine functions from the patch coefficients. - Interior regions: ci∈R2c_i \in \mathbb{R}^26 follows by ci∈R2c_i \in \mathbb{R}^27, tracing parabolic arcs (Kumar et al., 2021).

  2. Reassemble: take the supremum over all per-cell conjugates to form ci∈R2c_i \in \mathbb{R}^28, defined piecewise on a parabolic subdivision of the dual space.
  3. Take the conjugate again, ci∈R2c_i \in \mathbb{R}^29, restoring the closed convex envelope:

di∈Rd_i \in \mathbb{R}0

reducing to a piecewise function again, with regions corresponding to square-over-linear forms (Kumar et al., 2021). For the butterfly, this yields a piecewise rational envelope exactly matching the convex hull.

The process—involving subdivision, dualization, supremization, and re-dualization—is symbolic and, except for initial envelope computation, can be completed in linear time with respect to polygon edges (Kumar et al., 2021).

4. Convex Surrogate Fitting via Quadratic Programming

An alternative, data-driven approach to convexification fits a surrogate di∈Rd_i \in \mathbb{R}1 parametrically:

di∈Rd_i \in \mathbb{R}2

where di∈Rd_i \in \mathbb{R}3 are free parameters and di∈Rd_i \in \mathbb{R}4 are anchor points sampled across the butterfly domain (Schaller et al., 4 Jun 2025). By construction, di∈Rd_i \in \mathbb{R}5 is convex in di∈Rd_i \in \mathbb{R}6 for any di∈Rd_i \in \mathbb{R}7.

To fit di∈Rd_i \in \mathbb{R}8 to observed or simulated data di∈Rd_i \in \mathbb{R}9, solve the convex quadratic program: \begin{align*} \min_{f_i,\,g_i} &\quad \sum_{i=1}N (f_i - y_i)2 + \lambda \sum_{i=1}N |g_i|_22 \ \text{s.t.} &\quad f_j \geq f_i + g_i\top (x_j - x_i),\quad i,j=1,\dots,N, \end{align*} where PiP_i0 regularizes the subgradients and constraints enforce convexity and disciplined convex programming (DCP) compliance (Schaller et al., 4 Jun 2025).

Sampling PiP_i1 on a fine grid (e.g., PiP_i2 over PiP_i3), the procedure fits the convex envelope in seconds using solvers (CVX, CVXPY, MOSEK, Gurobi). Evaluation via RMSE on held-out data reveals that the surrogate matches the main convex "envelope" of the butterfly efficiently, with full reproducibility and guarantee of global optimality of the fitted envelope (Schaller et al., 4 Jun 2025).

5. Symbolic and Numerical Implementation Considerations

Symbolic envelope computation, especially for indefinite quadratics, requires polyhedral subdivision and management of rational-over-linear forms for each cell. The conjugation and biconjugation steps can be implemented in PiP_i4 time, where PiP_i5 is the cumulative number of edges across all subpolygons. The bottleneck remains the initial envelope calculation, which can be exponential in the polygonal complexity unless PiP_i6 is positive semidefinite.

Numerically, the QP-based fitting method allows convex envelopes to be learned directly from sampled data and interfaced with DCP-compliant modeling languages. Hyperparameters, notably PiP_i7, control surrogate smoothness and prevent overfitting or oscillatory fit; cross-validation is recommended for selection (Schaller et al., 4 Jun 2025).

Evaluating the fit involves computing PiP_i8 on test grids and reporting RMSE. For grid sizes (PiP_i9) and moderate QiQ_i0, the convex hull-style surrogate consistently captures the convex envelope with low average error (Schaller et al., 4 Jun 2025).

6. Applications and Significance in Convex Analysis

Convexification of butterfly-shaped functions formalizes the process of bridging nonconvex quadratic surfaces with convex optimization frameworks. This is salient for parametric modeling of optimization families and specification in domain-specific languages for convex programming (Schaller et al., 4 Jun 2025). The techniques described—symbolic envelope with explicit formulas and QP-based surrogate fitting—are foundational for:

  • Analyzing piecewise-quadratic maps in robust control, signal processing, and statistics,
  • Enabling disciplined programmatic convexity in optimization modeling systems,
  • Providing benchmark examples for algorithmic, symbolic, and numeric convexification strategies.

A plausible implication is that convex surrogate fitting and explicit envelope construction methods generalize to broader nonconvex and piecewise-defined surfaces beyond the butterfly, especially with improvements in computational geometry and symbolic algebraic methods for envelope determination.

7. Complexity and Algorithmic Efficiency

  • Envelope Computation: Exponential in the number of polygon vertices for indefinite quadratics; bottleneck of symbolic approach (Kumar et al., 2021).
  • Conjugation and Biconjugation: Linear time in total edge number QiQ_i1; per-cell dualization and pointwise supremum are efficient.
  • QP Surrogate Fitting: Numerical solvers compute the global optimum rapidly for practical QiQ_i2; reproducible and DCP-compliant (Schaller et al., 4 Jun 2025).

All steps, aside from initial envelope decomposition, admit streamlined, implementable routines. No additional complexity is induced by vertices at which numerator and denominator vanish simultaneously; extension by continuity suffices.

Step Symbolic Envelope (Kumar et al., 2021) Convex QP Surrogate (Schaller et al., 4 Jun 2025)
Data Required Closed-form parameters Sampled grid points QiQ_i3
Complexity QiQ_i4 (excluding envelope) QiQ_i5 (QP solver)
Result Description Piecewise rational (square/linear) Max-of-affine hyperplane envelope

Explicit construction and QP fitting both guarantee global convexity and approximation fidelity for the butterfly-shaped surface.

Definition Search Book Streamline Icon: https://streamlinehq.com
References (2)

Topic to Video (Beta)

No one has generated a video about this topic yet.

Whiteboard

No one has generated a whiteboard explanation for this topic yet.

Follow Topic

Get notified by email when new papers are published related to Convexifying Butterfly Shaped Function.