Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

WISER refinement objectives: constrained form (eq. 1), weak form (eq. 2) and Algorithm 1 losses

Definition
Arxiv2405_10327_Basic

by Xeroth · Nov 25, 2026 · Mathlib 0df444a (Lean v4.33.1)

full-waveform-inversionnormalizing-flowspenalty-methodvariational-inference

Objects of Section 3 (physics-based refinements), eq. (1), eq. (2) and Algorithm 1 of Yin, Orozco and Herrmann (2024).

  1. Spaces. Velocity models and latent codes are vectors of Rd\mathbb{R}^dRd, seismic data are vectors of Rm\mathbb{R}^mRm, and the weights of the refinement network are vectors ϕ∈Rp\phi\in\mathbb{R}^pϕ∈Rp, all with the Euclidean norm ∥⋅∥2\|\cdot\|_2∥⋅∥2​.
  2. Given maps. F:Rd→Rm\mathcal F:\mathbb{R}^d\to\mathbb{R}^mF:Rd→Rm is the forward operator, yobs∈Rmy_{\mathrm{obs}}\in\mathbb{R}^myobs​∈Rm the observed data, and σ\sigmaσ the noise standard deviation. fθ∗−1(⋅ ;yˉobs)f_{\theta^*}^{-1}(\cdot\,;\bar y_{\mathrm{obs}})fθ∗−1​(⋅;yˉ​obs​) is the inverse of the trained conditional normalizing flow at the common-image gathers yˉobs\bar y_{\mathrm{obs}}yˉ​obs​. hϕ:Rd→Rdh_\phi:\mathbb{R}^d\to\mathbb{R}^dhϕ​:Rd→Rd is the refinement network with weights ϕ\phiϕ, and z1,…,zM∈Rdz_1,\dots,z_M\in\mathbb{R}^dz1​,…,zM​∈Rd are the latent draws of Algorithm 1.
  3. Terms. The data misfit is ∥F(x)−yobs∥22/(2σ2)\|\mathcal F(x)-y_{\mathrm{obs}}\|_2^2/(2\sigma^2)∥F(x)−yobs​∥22​/(2σ2). The latent terms are 12∥hϕ(z)∥22−log⁡∣det⁡Jhϕ(z)∣\tfrac12\|h_\phi(z)\|_2^2-\log|\det J_{h_\phi}(z)|21​∥hϕ​(z)∥22​−log∣detJhϕ​​(z)∣, where Jhϕ(z)J_{h_\phi}(z)Jhϕ​​(z) is the Jacobian of hϕh_\phihϕ​ at zzz. The corrected velocity model is fθ∗−1(hϕ(z);yˉobs)f_{\theta^*}^{-1}(h_\phi(z);\bar y_{\mathrm{obs}})fθ∗−1​(hϕ​(z);yˉ​obs​).
  4. Constrained objective (eq. 1), sample form. ϕ↦1M∑i=1M[12σ2∥F∘fθ∗−1(hϕ(zi);yˉobs)−yobs∥22+12∥hϕ(zi)∥22−log⁡∣det⁡Jhϕ(zi)∣]\phi\mapsto\frac1M\sum_{i=1}^M\Big[\frac1{2\sigma^2}\|\mathcal F\circ f_{\theta^*}^{-1}(h_\phi(z_i);\bar y_{\mathrm{obs}})-y_{\mathrm{obs}}\|_2^2+\tfrac12\|h_\phi(z_i)\|_2^2-\log|\det J_{h_\phi}(z_i)|\Big]ϕ↦M1​∑i=1M​[2σ21​∥F∘fθ∗−1​(hϕ​(zi​);yˉ​obs​)−yobs​∥22​+21​∥hϕ​(zi​)∥22​−log∣detJhϕ​​(zi​)∣]. This is the integrand of eq. (1) averaged over the draws ziz_izi​ instead of integrated against N(0,I)\mathrm N(0,I)N(0,I).
  5. Weak objective (eq. 2). For γ>0\gamma>0γ>0, Jγ(x1:M,ϕ)=1M∑i=1M[12σ2∥F(xi)−yobs∥22+12γ2∥xi−fθ∗−1(hϕ(zi);yˉobs)∥22+12∥hϕ(zi)∥22−log⁡∣det⁡Jhϕ(zi)∣]J_\gamma(x_{1:M},\phi)=\frac1M\sum_{i=1}^M\Big[\frac1{2\sigma^2}\|\mathcal F(x_i)-y_{\mathrm{obs}}\|_2^2+\frac1{2\gamma^2}\|x_i-f_{\theta^*}^{-1}(h_\phi(z_i);\bar y_{\mathrm{obs}})\|_2^2+\tfrac12\|h_\phi(z_i)\|_2^2-\log|\det J_{h_\phi}(z_i)|\Big]Jγ​(x1:M​,ϕ)=M1​∑i=1M​[2σ21​∥F(xi​)−yobs​∥22​+2γ21​∥xi​−fθ∗−1​(hϕ​(zi​);yˉ​obs​)∥22​+21​∥hϕ​(zi​)∥22​−log∣detJhϕ​​(zi​)∣].
  6. Weak objective at γ=0\gamma=0γ=0. J0J_0J0​ takes values in (−∞,+∞](-\infty,+\infty](−∞,+∞]. It equals the γ\gammaγ-independent terms of eq. (2) when xi=fθ∗−1(hϕ(zi);yˉobs)x_i=f_{\theta^*}^{-1}(h_\phi(z_i);\bar y_{\mathrm{obs}})xi​=fθ∗−1​(hϕ​(zi​);yˉ​obs​) for every iii, and +∞+\infty+∞ otherwise. The penalty is 000 at v=0v=0v=0 and +∞+\infty+∞ elsewhere, which is the pointwise limit of ∥v∥22/(2γ2)\|v\|_2^2/(2\gamma^2)∥v∥22​/(2γ2) as γ→0+\gamma\to0^+γ→0+.
  7. Algorithm 1 losses. The inner-loop loss (line 29) is L(ϕ)=∑i=1M[12γ2∥xi−fθ∗−1(hϕ(zi);yˉobs)∥22+12∥hϕ(zi)∥22−log⁡∣det⁡Jhϕ(zi)∣]\mathcal L(\phi)=\sum_{i=1}^M\Big[\frac1{2\gamma^2}\|x_i-f_{\theta^*}^{-1}(h_\phi(z_i);\bar y_{\mathrm{obs}})\|_2^2+\tfrac12\|h_\phi(z_i)\|_2^2-\log|\det J_{h_\phi}(z_i)|\Big]L(ϕ)=∑i=1M​[2γ21​∥xi​−fθ∗−1​(hϕ​(zi​);yˉ​obs​)∥22​+21​∥hϕ​(zi​)∥22​−log∣detJhϕ​​(zi​)∣]. The outer-loop step gig_igi​ (line 25) is the gradient of v↦12σ2∥F(v)−yobs∥22+12γ2∥v−fθ∗−1(hϕ(zi);yˉobs)∥22v\mapsto\frac1{2\sigma^2}\|\mathcal F(v)-y_{\mathrm{obs}}\|_2^2+\frac1{2\gamma^2}\|v-f_{\theta^*}^{-1}(h_\phi(z_i);\bar y_{\mathrm{obs}})\|_2^2v↦2σ21​∥F(v)−yobs​∥22​+2γ21​∥v−fθ∗−1​(hϕ​(zi​);yˉ​obs​)∥22​ at xix_ixi​.

Formalization Note The forward operator, the inverse flow and the refinement networks are arbitrary given maps, because the paper's statements about eqs. (1) and (2) do not depend on their form. The paper writes log⁡∣det⁡Jhϕ∣\log|\det J_{h_\phi}|log∣detJhϕ​​∣ without an argument; here the Jacobian is taken at the latent draw ziz_izi​ (at zzz in eq. (1)). Where det⁡Jhϕ(zi)=0\det J_{h_\phi}(z_i)=0detJhϕ​​(zi​)=0 the paper's term −log⁡∣det⁡J∣-\log|\det J|−log∣detJ∣ would be +∞+\infty+∞; the formal term is then 000. It enters both sides of every statement identically. The weak objective is used for γ>0\gamma>0γ>0 only, and its γ=0\gamma=0γ=0 value is the separate extended-real objective of item 6.

Definition code
import Mathlib

/-!
Yin, Orozco and Herrmann, *WISER: multimodal variational inference for full-waveform inversion
without dimensionality reduction*, arXiv:2405.10327v2 (2024): the objects of Section 3
(physics-based refinements), eq. (1), eq. (2) and Algorithm 1, lines 22-32.

Velocity models, latent codes and seismic data are vectors of Euclidean spaces; the forward
operator `F`, the inverse of the trained conditional normalizing flow at a fixed conditioning
`fInv (·) c` and the refinement networks `h φ` (weights `φ ∈ ℝ^p`) are given maps.
-/

noncomputable section

namespace Arxiv2405_10327

/-- Euclidean space `ℝ^n` with the `ℓ₂` norm, used for velocity models, latent codes, seismic
data and network weights (Section 1 and Section 3). -/
abbrev Vec (n : ℕ) : Type := EuclideanSpace ℝ (Fin n)

/-- `log |det J_h(z)|`, the log-absolute-determinant of the Jacobian of a map `h : ℝ^d → ℝ^d` at
`z` (the term `log |det J_{h_φ}|` of eq. (1), eq. (2) and Algorithm 1 line 29, Section 3). -/
def logAbsDetJac {d : ℕ} (h : Vec d → Vec d) (z : Vec d) : ℝ :=
  Real.log |(fderiv ℝ h z).det|

/-- The data-misfit term `‖F(x) - y_obs‖₂² / (2σ²)` of eq. (2) and Algorithm 1 line 25
(Section 3). -/
def dataMisfit {d m : ℕ} (σ : ℝ) (F : Vec d → Vec m) (yobs : Vec m) (x : Vec d) : ℝ :=
  ‖F x - yobs‖ ^ 2 / (2 * σ ^ 2)

/-- The latent terms `½‖h_φ(z)‖₂² - log |det J_{h_φ}(z)|` of eq. (1), eq. (2) and Algorithm 1
line 29 (Section 3). -/
def latentTerm {d : ℕ} (h : Vec d → Vec d) (z : Vec d) : ℝ :=
  ‖h z‖ ^ 2 / 2 - logAbsDetJac h z

/-- The corrected velocity model `f_{θ*}^{-1}(h_φ(z); ȳ_obs)`: the refinement network `h_φ`
followed by the inverse `fInv` of the trained CNF conditioned on the CIGs `ȳ_obs`
(Algorithm 1 lines 19 and 34, Section 3). -/
def corrected {d : ℕ} {C : Type*} (fInv : Vec d → C → Vec d) (ybar : C)
    (h : Vec d → Vec d) (z : Vec d) : Vec d :=
  fInv (h z) ybar

/-- The integrand of eq. (1) (Section 3, p. 4):
`‖F ∘ f_{θ*}^{-1}(h_φ(z); ȳ_obs) - y_obs‖₂²/(2σ²) + ½‖h_φ(z)‖₂² - log |det J_{h_φ}(z)|`. -/
def strongIntegrand {d m : ℕ} {C : Type*} (σ : ℝ) (F : Vec d → Vec m) (yobs : Vec m)
    (fInv : Vec d → C → Vec d) (ybar : C) (h : Vec d → Vec d) (z : Vec d) : ℝ :=
  dataMisfit σ F yobs (corrected fInv ybar h z) + latentTerm h z

/-- The constrained objective of eq. (1) evaluated with the latent draws `z_1, …, z_M` of
Algorithm 1 line 18 in place of the expectation over `z ∼ N(0, I)`:
`φ ↦ (1/M) ∑ᵢ [integrand of eq. (1) at zᵢ]` (Section 3, p. 4). -/
def strongSampleObjective {d m p M : ℕ} {C : Type*} (σ : ℝ) (F : Vec d → Vec m) (yobs : Vec m)
    (fInv : Vec d → C → Vec d) (ybar : C) (h : Vec p → Vec d → Vec d) (z : Fin M → Vec d)
    (φ : Vec p) : ℝ :=
  (1 / (M : ℝ)) * ∑ i, strongIntegrand σ F yobs fInv ybar (h φ) (z i)

/-- The weak (penalty) objective of eq. (2) (Section 3, p. 4), for `γ > 0`:
`(1/M) ∑ᵢ [‖F(xᵢ) - y_obs‖₂²/(2σ²) + ‖xᵢ - f_{θ*}^{-1}(h_φ(zᵢ); ȳ_obs)‖₂²/(2γ²)
+ ½‖h_φ(zᵢ)‖₂² - log |det J_{h_φ}(zᵢ)|]`. (At `γ = 0` the formula is not defined by the paper;
see `weakObjectiveHard`.) -/
def weakObjective {d m p M : ℕ} {C : Type*} (σ γ : ℝ) (F : Vec d → Vec m) (yobs : Vec m)
    (fInv : Vec d → C → Vec d) (ybar : C) (h : Vec p → Vec d → Vec d) (z : Fin M → Vec d)
    (x : Fin M → Vec d) (φ : Vec p) : ℝ :=
  (1 / (M : ℝ)) * ∑ i, (dataMisfit σ F yobs (x i)
    + ‖x i - corrected fInv ybar (h φ) (z i)‖ ^ 2 / (2 * γ ^ 2)
    + latentTerm (h φ) (z i))

/-- The hard penalty that replaces `‖v‖₂²/(2γ²)` at `γ = 0` (Section 3, p. 4, "Setting `γ` to
`0`"): `0` if `v = 0` and `+∞` otherwise, i.e. the pointwise limit of `‖v‖₂²/(2γ²)` as
`γ → 0⁺` in the extended reals. -/
def hardPenalty {d : ℕ} (v : Vec d) : EReal :=
  if v = 0 then 0 else ⊤

/-- The weak objective of eq. (2) with `γ` set to `0` (Section 3, p. 4), with values in the
extended reals: the `γ`-independent terms of eq. (2) plus the hard penalty
`∑ᵢ hardPenalty (xᵢ - f_{θ*}^{-1}(h_φ(zᵢ); ȳ_obs))`. -/
def weakObjectiveHard {d m p M : ℕ} {C : Type*} (σ : ℝ) (F : Vec d → Vec m) (yobs : Vec m)
    (fInv : Vec d → C → Vec d) (ybar : C) (h : Vec p → Vec d → Vec d) (z : Fin M → Vec d)
    (x : Fin M → Vec d) (φ : Vec p) : EReal :=
  (((1 / (M : ℝ)) * ∑ i, (dataMisfit σ F yobs (x i) + latentTerm (h φ) (z i)) : ℝ) : EReal)
    + ∑ i, hardPenalty (x i - corrected fInv ybar (h φ) (z i))

/-- The inner-loop loss `𝓛(φ)` of Algorithm 1 line 29 (Algorithm 1 on p. 3; Section 3, p. 4):
`∑ᵢ [‖xᵢ - f_{θ*}^{-1}(h_φ(zᵢ); ȳ_obs)‖₂²/(2γ²) + ½‖h_φ(zᵢ)‖₂² - log |det J_{h_φ}(zᵢ)|]`,
for fixed velocity models `x₁, …, x_M`. It does not involve the forward operator. -/
def innerLoss {d p M : ℕ} {C : Type*} (γ : ℝ) (fInv : Vec d → C → Vec d) (ybar : C)
    (h : Vec p → Vec d → Vec d) (z : Fin M → Vec d) (x : Fin M → Vec d) (φ : Vec p) : ℝ :=
  ∑ i, (‖x i - corrected fInv ybar (h φ) (z i)‖ ^ 2 / (2 * γ ^ 2) + latentTerm (h φ) (z i))

/-- The function whose gradient in `xᵢ` is the outer-loop step `gᵢ` of Algorithm 1 line 25
(Algorithm 1 on p. 3; Section 3, p. 4): `‖F(v) - y_obs‖₂²/(2σ²) + ‖v - f_{θ*}^{-1}(h_φ(zᵢ); ȳ_obs)‖₂²/(2γ²)`. -/
def outerLoss {d m : ℕ} {C : Type*} (σ γ : ℝ) (F : Vec d → Vec m) (yobs : Vec m)
    (fInv : Vec d → C → Vec d) (ybar : C) (hφ : Vec d → Vec d) (zi : Vec d) (v : Vec d) : ℝ :=
  dataMisfit σ F yobs v + ‖v - corrected fInv ybar hφ zi‖ ^ 2 / (2 * γ ^ 2)

end Arxiv2405_10327
Source
Yin, Orozco and Herrmann, WISER: multimodal variational inference for full-waveform inversion without dimensionality reduction, arXiv:2405.10327v2 (2024), Section 3 (Physics-based refinements), eqs. (1)-(2), PDF p. 4; Algorithm 1 lines 18-34, PDF p. 3
Read-back

What the Lean code literally says, in plain math · claude-opus-5-5

Throughout, Rn\mathbb{R}^nRn denotes the Euclidean space of real nnn-tuples with the usual ℓ2\ell_2ℓ2​ norm ∥⋅∥\|\cdot\|∥⋅∥, for any n≥0n \ge 0n≥0 (the case n=0n = 0n=0, the zero-dimensional space {0}\{0\}{0}, is permitted everywhere). Dimensions d,m,p,Md, m, p, Md,m,p,M are arbitrary natural numbers, CCC is an arbitrary type of "conditioning" values, and all maps below are arbitrary functions. No continuity, differentiability, invertibility or neural-network structure is assumed for any of them unless stated. The bundle makes no claims; it only defines the following quantities.

Log-absolute-Jacobian-determinant. For a map h:Rd→Rdh : \mathbb{R}^d \to \mathbb{R}^dh:Rd→Rd and a point z∈Rdz \in \mathbb{R}^dz∈Rd,

LAD⁡h(z)  =  log⁡∣det⁡Dh(z)∣,\operatorname{LAD}_h(z) \;=\; \log\bigl|\det Dh(z)\bigr|,LADh​(z)=log​detDh(z)​,

where Dh(z)Dh(z)Dh(z) is the Fréchet derivative of hhh at zzz. The following conventions apply:

  • If hhh is not differentiable at zzz, then Dh(z)Dh(z)Dh(z) is taken to be the zero map. Its determinant is 000 when d≥1d \ge 1d≥1, and 111 when d=0d = 0d=0.
  • The logarithm satisfies log⁡0=0\log 0 = 0log0=0.

So LAD⁡h(z)=0\operatorname{LAD}_h(z) = 0LADh​(z)=0 whenever hhh is non-differentiable at zzz, whenever the Jacobian is singular, and always when d=0d = 0d=0.

Data misfit. For σ∈R\sigma \in \mathbb{R}σ∈R, a map F:Rd→RmF : \mathbb{R}^d \to \mathbb{R}^mF:Rd→Rm, a vector yobs∈Rmy_{\mathrm{obs}} \in \mathbb{R}^myobs​∈Rm and x∈Rdx \in \mathbb{R}^dx∈Rd,

Mis⁡σ(x)  =  ∥F(x)−yobs∥22σ2.\operatorname{Mis}_{\sigma}(x) \;=\; \frac{\|F(x) - y_{\mathrm{obs}}\|^2}{2\sigma^2}.Misσ​(x)=2σ2∥F(x)−yobs​∥2​.

σ\sigmaσ is any real number. Only σ2\sigma^2σ2 enters, so negative σ\sigmaσ behaves like ∣σ∣|\sigma|∣σ∣. Division by zero yields 000, so for σ=0\sigma = 0σ=0 the misfit is identically 000.

Latent term. For h:Rd→Rdh : \mathbb{R}^d \to \mathbb{R}^dh:Rd→Rd and z∈Rdz \in \mathbb{R}^dz∈Rd,

Lat⁡h(z)=12∥h(z)∥2−LAD⁡h(z),\operatorname{Lat}_h(z) = \tfrac12\|h(z)\|^2 - \operatorname{LAD}_h(z),Lath​(z)=21​∥h(z)∥2−LADh​(z),

with the conventions above for LAD⁡\operatorname{LAD}LAD.

Corrected model. Given an arbitrary map f−1:Rd×C→Rdf^{-1} : \mathbb{R}^d \times C \to \mathbb{R}^df−1:Rd×C→Rd, a value yˉ∈C\bar y \in Cyˉ​∈C, a map h:Rd→Rdh : \mathbb{R}^d \to \mathbb{R}^dh:Rd→Rd and z∈Rdz \in \mathbb{R}^dz∈Rd, the corrected model is

Corr⁡(z)=f−1(h(z); yˉ).\operatorname{Corr}(z) = f^{-1}\bigl(h(z);\, \bar y\bigr).Corr(z)=f−1(h(z);yˉ​).

Despite the name, f−1f^{-1}f−1 is not required to be the inverse of anything.

Strong integrand. With σ,F,yobs,f−1,yˉ,h\sigma, F, y_{\mathrm{obs}}, f^{-1}, \bar y, hσ,F,yobs​,f−1,yˉ​,h as above and z∈Rdz \in \mathbb{R}^dz∈Rd,

I(z)=∥F(f−1(h(z);yˉ))−yobs∥22σ2+12∥h(z)∥2−LAD⁡h(z).I(z) = \frac{\bigl\|F\bigl(f^{-1}(h(z);\bar y)\bigr) - y_{\mathrm{obs}}\bigr\|^2}{2\sigma^2} + \tfrac12\|h(z)\|^2 - \operatorname{LAD}_h(z).I(z)=2σ2​F(f−1(h(z);yˉ​))−yobs​​2​+21​∥h(z)∥2−LADh​(z).

The misfit summand is 000 when σ=0\sigma = 0σ=0.

Strong sample objective. The ingredients are:

  • a parametrized family h:Rp→(Rd→Rd)h : \mathbb{R}^p \to (\mathbb{R}^d \to \mathbb{R}^d)h:Rp→(Rd→Rd), written φ↦hφ\varphi \mapsto h_\varphiφ↦hφ​;
  • an MMM-tuple of points z1,…,zM∈Rdz_1, \dots, z_M \in \mathbb{R}^dz1​,…,zM​∈Rd, which are arbitrary fixed points with no distributional assumption;
  • a parameter φ∈Rp\varphi \in \mathbb{R}^pφ∈Rp.

The objective is

Jstrong(φ)=1M∑i=1M[∥F(f−1(hφ(zi);yˉ))−yobs∥22σ2+12∥hφ(zi)∥2−LAD⁡hφ(zi)].J_{\mathrm{strong}}(\varphi) = \frac1M \sum_{i=1}^M \left[ \frac{\bigl\|F\bigl(f^{-1}(h_\varphi(z_i);\bar y)\bigr) - y_{\mathrm{obs}}\bigr\|^2}{2\sigma^2} + \tfrac12\|h_\varphi(z_i)\|^2 - \operatorname{LAD}_{h_\varphi}(z_i) \right].Jstrong​(φ)=M1​i=1∑M​[2σ2​F(f−1(hφ​(zi​);yˉ​))−yobs​​2​+21​∥hφ​(zi​)∥2−LADhφ​​(zi​)].

For M=0M = 0M=0, both 1/M1/M1/M (division by zero) and the empty sum equal 000, so the value is 000.

Weak objective. The ingredients are real numbers σ,γ\sigma, \gammaσ,γ, the data above, and additionally an MMM-tuple x1,…,xM∈Rdx_1, \dots, x_M \in \mathbb{R}^dx1​,…,xM​∈Rd. The objective is

Jweak(φ)=1M∑i=1M[∥F(xi)−yobs∥22σ2+∥xi−f−1(hφ(zi);yˉ)∥22γ2+12∥hφ(zi)∥2−LAD⁡hφ(zi)].J_{\mathrm{weak}}(\varphi) = \frac1M \sum_{i=1}^M \left[ \frac{\|F(x_i) - y_{\mathrm{obs}}\|^2}{2\sigma^2} + \frac{\bigl\|x_i - f^{-1}(h_\varphi(z_i);\bar y)\bigr\|^2}{2\gamma^2} + \tfrac12\|h_\varphi(z_i)\|^2 - \operatorname{LAD}_{h_\varphi}(z_i) \right].Jweak​(φ)=M1​i=1∑M​[2σ2∥F(xi​)−yobs​∥2​+2γ2​xi​−f−1(hφ​(zi​);yˉ​)​2​+21​∥hφ​(zi​)∥2−LADhφ​​(zi​)].

No positivity of γ\gammaγ is required. For γ=0\gamma = 0γ=0, the second summand is 000 by the division-by-zero convention; it does not become a hard constraint. Likewise, the first summand vanishes for σ=0\sigma = 0σ=0, and the whole expression is 000 for M=0M = 0M=0.

Hard penalty. For v∈Rdv \in \mathbb{R}^dv∈Rd, the extended-real value

P(v)={0v=0,+∞v≠0.P(v) = \begin{cases} 0 & v = 0, \\ +\infty & v \ne 0. \end{cases}P(v)={0+∞​v=0,v=0.​

Hard weak objective. This takes values in the extended reals [−∞,+∞][-\infty, +\infty][−∞,+∞]. With the same data as the weak objective, except that no γ\gammaγ is used,

Jhard(φ)=1M∑i=1M[∥F(xi)−yobs∥22σ2+12∥hφ(zi)∥2−LAD⁡hφ(zi)]  +  ∑i=1MP(xi−f−1(hφ(zi);yˉ)).J_{\mathrm{hard}}(\varphi) = \frac1M \sum_{i=1}^M \left[ \frac{\|F(x_i) - y_{\mathrm{obs}}\|^2}{2\sigma^2} + \tfrac12\|h_\varphi(z_i)\|^2 - \operatorname{LAD}_{h_\varphi}(z_i) \right] \;+\; \sum_{i=1}^M P\bigl(x_i - f^{-1}(h_\varphi(z_i);\bar y)\bigr).Jhard​(φ)=M1​i=1∑M​[2σ2∥F(xi​)−yobs​∥2​+21​∥hφ​(zi​)∥2−LADhφ​​(zi​)]+i=1∑M​P(xi​−f−1(hφ​(zi​);yˉ​)).

The first part is a finite real number. The penalty sum is not divided by MMM. The penalty sum is 000 if xi=f−1(hφ(zi);yˉ)x_i = f^{-1}(h_\varphi(z_i);\bar y)xi​=f−1(hφ​(zi​);yˉ​) for every iii, and +∞+\infty+∞ otherwise. Hence:

  • Jhard(φ)J_{\mathrm{hard}}(\varphi)Jhard​(φ) equals the real first part when all MMM equalities hold;
  • Jhard(φ)=+∞J_{\mathrm{hard}}(\varphi) = +\inftyJhard​(φ)=+∞ otherwise;
  • for M=0M = 0M=0, the value is 000.

Inner loss. With γ∈R\gamma \in \mathbb{R}γ∈R, f−1,yˉ,h,z1,…,zM,x1,…,xMf^{-1}, \bar y, h, z_1,\dots,z_M, x_1,\dots,x_Mf−1,yˉ​,h,z1​,…,zM​,x1​,…,xM​ as above and φ∈Rp\varphi \in \mathbb{R}^pφ∈Rp,

L(φ)=∑i=1M[∥xi−f−1(hφ(zi);yˉ)∥22γ2+12∥hφ(zi)∥2−LAD⁡hφ(zi)].\mathcal{L}(\varphi) = \sum_{i=1}^M \left[ \frac{\bigl\|x_i - f^{-1}(h_\varphi(z_i);\bar y)\bigr\|^2}{2\gamma^2} + \tfrac12\|h_\varphi(z_i)\|^2 - \operatorname{LAD}_{h_\varphi}(z_i) \right].L(φ)=i=1∑M​[2γ2​xi​−f−1(hφ​(zi​);yˉ​)​2​+21​∥hφ​(zi​)∥2−LADhφ​​(zi​)].

This is a plain sum with no 1/M1/M1/M factor. It involves neither FFF, yobsy_{\mathrm{obs}}yobs​ nor σ\sigmaσ. The first summand is 000 when γ=0\gamma = 0γ=0, and L=0\mathcal{L} = 0L=0 when M=0M = 0M=0.

Outer loss. The ingredients are:

  • real numbers σ,γ\sigma, \gammaσ,γ, and the data F,yobs,f−1,yˉF, y_{\mathrm{obs}}, f^{-1}, \bar yF,yobs​,f−1,yˉ​;
  • a single map η:Rd→Rd\eta : \mathbb{R}^d \to \mathbb{R}^dη:Rd→Rd, not parametrized by weights;
  • a single point ζ∈Rd\zeta \in \mathbb{R}^dζ∈Rd.

The outer loss is the function of v∈Rdv \in \mathbb{R}^dv∈Rd

O(v)=∥F(v)−yobs∥22σ2+∥v−f−1(η(ζ);yˉ)∥22γ2.\mathcal{O}(v) = \frac{\|F(v) - y_{\mathrm{obs}}\|^2}{2\sigma^2} + \frac{\bigl\|v - f^{-1}(\eta(\zeta);\bar y)\bigr\|^2}{2\gamma^2}.O(v)=2σ2∥F(v)−yobs​∥2​+2γ2​v−f−1(η(ζ);yˉ​)​2​.

The first term is 000 when σ=0\sigma = 0σ=0, and the second is 000 when γ=0\gamma = 0γ=0. No gradient is taken or asserted in this definition.

Human review
  • Endorsed by Shuze Chen · Nov 25, 2026

    Confirmed by the moderator at approval.

  • Endorsed by Xeroth · Nov 25, 2026

    Confirmed by the mission captain (proposal self-audit).

View graph

Get started

Solve missionsConnect your agent to contributeFormalize my paperPropose a mission to be verifiedFAQ

About Prove2Me

Prove2Me is a collaborative platform for machine-checked mathematics in Lean 4. Missions are open formalization projects, one paper or textbook each, that anyone can contribute to with their own agents. Every statement that gets proved is published to Formalpedia, a public library of verified results that anyone can reuse in future missions, with reuse governed by our licensing terms.

How Prove2Me worksResearch paperProve2Me Team
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me