We show: if f′′(x)≥0 everywhere, then the tangent-line condition (Lens 2) holds.
Step 1 — Taylor with exact remainder. For some c between x and y:
f(y)=f(x)+f′(x)(y−x)+21f′′(c)(y−x)2.Why this step? Taylor's theorem gives an exact expression, isolating the curvature term.
Step 2 — Bound the remainder. Since f′′(c)≥0 and (y−x)2≥0:
21f′′(c)(y−x)2≥0.Why this step? This is the only unknown term; nonnegative curvature makes it nonnegative.
Hessian eigenvalues 2,−2 (indefinite); origin is a saddle point.
What functions are both convex AND concave?
Only affine (linear + constant) functions.
Why do neural nets have non-convex loss?
Composition of nonlinear activations creates multiple minima/saddles ⇒ Hessian not PSD everywhere.
First-order convexity condition
f(y)≥f(x)+∇f(x)⊤(y−x) — graph lies above every tangent line.
Recall Feynman: explain to a 12-year-old
Imagine a skateboard ramp. A convex ramp is a single smooth U-shaped bowl: no matter where you drop a marble, it always rolls down to the same lowest point. Easy — you can't get stuck. A non-convex ramp is a bumpy skate park with many dips. Your marble might stop in a small dip that isn't the deepest one, thinking "I'm done!" while a deeper valley sits right over the hill. Convex = one honest bowl; non-convex = tricky landscape with fake bottoms.
Dekho, machine learning me hum hamesha ek loss function ko minimize karte hain — matlab aise parameters dhoondhna jaha error sabse kam ho. Ab yaha sawal aata hai: function ka shape kaisa hai? Agar function convex hai, toh woh ek single katora (bowl) jaisa hota hai. Kahin se bhi marble chhodo, woh ghum-ghum ke same sabse neeche wale point pe pahunch jaata hai. Iska matlab: gradient descent chalao, aur guaranteed global minimum mil jaayega. No tension of getting stuck.
Convex check karne ka sabse practical tareeka: second derivative. 1D me agar f′′(x)≥0 har jagah (poore domain me, sirf ek point pe nahi!), toh function convex hai. Multi-dimension me yahi cheez Hessian matrix ke through hoti hai — Hessian positive semidefinite honi chahiye (saare eigenvalues ≥0). Jaise x2 ka f′′=2 hamesha positive — convex. Lekin x3 ka f′′=6x kabhi negative kabhi positive — isliye NON-convex.
Non-convex functions me kai saare valleys hote hain — bilkul bumpy skate park jaisa. Gradient descent kisi chhoti si dip me phas sakta hai (local minimum) aur soch le "bas ho gaya," jabki asli deepest valley pahaad ke us paar hai. Neural networks ka loss aisa hi non-convex hota hai, kyunki nonlinear activations layer-by-layer milke bahut tedhi-medhi landscape bana dete hain.
Yaad rakhne ka simple funda: convex ka matlab local minimum hi global minimum hota hai — yahi convexity ka asli power hai. Non-convex me yeh guarantee tut jaati hai. Isliye jab bhi koi optimization problem dekho, pehle poochho: "Yeh convex hai kya?" — agar haan, toh life easy; agar nahi, toh tricks (random restarts, momentum, etc.) chahiye.