Lasso keeps the same through-origin rational setup as ridge, but swaps the squared penalty for an absolute-value penalty. The change is exact and visible.
highlighted = computed this step
Same through-origin setup
Use the through-origin model y≈w*x on the exact points (1, 2), (2, 4), and (3, 6). The source sums are sum xy=28 and sum x squared=14.
y≈wx,∑xy=28,∑x2=14
Swap the penalty
Ridge uses a squared-weight penalty. Lasso swaps in the absolute-value penalty |w|. The objective convention here is one-half times squared error plus λ|w|, so the threshold formula stays clean.
1/2i∑(yi−wxi)2+λ∣w∣
Summary
The data and model are exact rationals. Only the penalty changes: Lasso uses |w|, which can make the final weight exactly zero.