Maybe there's a gap in my knowledge of notation, but I was confused by:
> Let’s define the Lagrange basis functions
It looks like you defined `l_i(x)` as a piecewise function or a step function.
But then you show with it's actual definition later in that section. (That's what that section is building to and explaining.)