Lemma
math, backwards
journey · 5 days · all four pillars

Vectors Everywhere

Four pillars hold the same tuple and call it different things — a point in graphics, a velocity in physics, a feature in ML, a weight in finance. Two operations — add and scale — make all four behave. This path opens the vectors module on day 1 and then spends one day in each pillar, watching the same algebra wear a different hat each time.

Lemma’s most-reused module hides in plain sight. The same module that draws Bezier curves also pushes a projectile, also steps a model downhill, also composes a portfolio. Reading the four applications one after another with the module open is the cleanest way to see why one piece of math is enough for four fields.

the path · 0/5 · 0%
  1. 1
    module·day 1·next
    /modules/vectors
    Open with the abstract object. A vector is a tuple plus two operations: addition and scalar multiplication. Read for the *roles* the module names — position, displacement, velocity, feature — each is the same algebra wearing a different hat. The next four days fill those hats with real pages.
    open →
  2. 2
    application·day 2
    /graphics/bezier-curves
    Pillar 1 — graphics. The control points the designer drags *are* vectors. The Bezier curve is built by repeated linear interpolation, which is *add* and *scale* iterated. The drawing on screen is the algebra running with no friction.
    open →
  3. 3
    application·day 3
    /physics/projectile-motion
    Pillar 2 — physics. The same tuple now names *motion*. Position and velocity are vectors evolving in time; gravity is a constant vector added each step. The graphics tuple stored *where*; the physics tuple stores *how it changes*. Algebra unchanged.
    open →
  4. 4
    application·day 4
    /ml/gradient-descent
    Pillar 3 — ML. The model's parameters are a vector; the gradient is a vector; the update step is *parameter ← parameter − α · gradient* — add and scale again. The *feature* role the module names lives here too: each training example is a vector in ℝⁿ.
    open →
  5. 5
    application·day 5
    /finance/portfolio-risk
    Pillar 4 — finance. The portfolio weights form a vector; the returns form a vector; the variance involves a dot product against a covariance matrix. The most famous portfolio formula is *literally* the |a + b|² identity from the vectors module, with finance-flavoured names on each term.
    open →