Reference · Signed rationals
rainbow.math.rational.signed.convex-function
The two-point convex-function representation over signed rationals, and its first witnesses -- the base for Jensen's inequality and for connecting convexity to the KKT / Lagrangian optimization lane. signed/convex-on f := for all nnrat weights w0,w1 with w0+w1~1 and signed x,y, f((w0)x + (w1)y) <= (w0) f(x) + (w1) f(y) (weights injected by from-nnrat; the combination is the same as signed/convex-*). signed/identity-convex : convex-on (x |-> x) -- trivial (equality, reflexive) signed/constant-convex : convex-on (x |-> c) -- via the weight-sum collapse identity: both sides reduce to the same combination, so at-most-reflexive closes it. constant: f collapses each side to c, and (w0)c + (w1)c ~ (w0+w1)c ~ 1*c ~ c via distributes-add-right + from-nnrat-add + (w0+w1~1) + multiply-one-left. Off the magnitude/reciprocal modulus (no reduction wall). Next: affine and square convexity (the variance inequality), then n-point Jensen by induction. Axiom-free; additive; does not touch the LP checker.
signed/convex-on
signed/convex-on : (x₁ : ℚ → ℚ) → Prop
ℚ = signed/SignedRational
signed/identity-convex
signed/identity-convex : → signed/convex-on (fun x => x)
signed/constant-convex
signed/constant-convex : (c : ℚ) → signed/convex-on (fun x₁ => c)
ℚ = signed/SignedRational