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)=12xQix+cix+di,xPiR2,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, ciR2c_i \in \mathbb{R}^2, diRd_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 envf\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_i is expressed in mixed form (bilinear x1x2x_1 x_2 plus affine),
  • Identify "McCormick-lines"—critical lines segmenting the region along which the bilinear nonconvexity is maximal,
  • Subdivide PiP_i into subpolygons PikP_{ik} along these lines (Kumar et al., 2021).

Within each PikP_{ik}, the convex envelope is written as

envfi(x)=(aikx+bik)2cikx+dik,\mathrm{env}\,f_i(x) = \frac{(a_{ik}^\top x + b_{ik})^2}{c_{ik}^\top x + d_{ik}},

with coefficients derived via supporting planes and convexity constraints. The envelope is always below ff, is piecewise rational, and its level sets are linearly ruled. The graph is C1C^1 but not typically C2C^2 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 ff^* for each rational envelope on PikP_{ik}:

    • Vertex regions: f(s)f^*(s) is affine, valid in normal cones at vertices.
    • Edge regions: f(s)f^*(s) admits a rational-over-square-root format,

    f(s)=ψ1(s)ζ0ψ1/2(s)+ψ0(s),f^*(s) = \frac{\psi_1(s)}{\zeta_0 \sqrt{\psi_{1/2}(s)} + \psi_0(s)},

    where ψ(s)\psi_\cdot(s), ζ0\zeta_0 are explicit affine functions from the patch coefficients. - Interior regions: f(s)f^*(s) follows by s=r(x)s = \nabla r(x), tracing parabolic arcs (Kumar et al., 2021).

  2. Reassemble: take the supremum over all per-cell conjugates to form (envf)(s)(\mathrm{env}\,f)^*(s), defined piecewise on a parabolic subdivision of the dual space.
  3. Take the conjugate again, f(x)f^{**}(x), restoring the closed convex envelope:

f(x)=sups{sx(envf)(s)},f^{**}(x) = \sup_{s} \left\{s^\top x - (\mathrm{env}\,f)^*(s)\right\},

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 f(x)f(x) parametrically:

f(x;θ)=max1iN{fi+gi(xxi)},f(x; \theta) = \max_{1 \leq i \leq N} \left\{f_i + g_i^\top (x - x_i)\right\},

where θ={fi,giR2}i=1N\theta = \{f_i, g_i \in \mathbb{R}^2\}_{i=1}^N are free parameters and xix_i are anchor points sampled across the butterfly domain (Schaller et al., 4 Jun 2025). By construction, f(x;θ)f(x;\theta) is convex in xx for any θ\theta.

To fit f(x;θ)f(x;\theta) to observed or simulated data yi=fmap(xi)y_i = f_{\rm map}(x_i), 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 λ\lambda regularizes the subgradients and constraints enforce convexity and disciplined convex programming (DCP) compliance (Schaller et al., 4 Jun 2025).

Sampling (xi,yi)(x_i, y_i) on a fine grid (e.g., N=2500N=2500 over [2,2]2[-2,2]^2), 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 O(N)O(N) time, where NN 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 QiQ_i 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 λ\lambda, 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 f^(x)\hat f(x) on test grids and reporting RMSE. For grid sizes (N=50×50N = 50\times50) and moderate λ\lambda, 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 NN; per-cell dualization and pointwise supremum are efficient.
  • QP Surrogate Fitting: Numerical solvers compute the global optimum rapidly for practical NN; 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 (xi,yi)(x_i, y_i)
Complexity O(N)\mathcal{O}(N) (excluding envelope) O(N2)\mathcal{O}(N^2) (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.