<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def tril(P, k=0):
 """Lower triangle of coefficients."""

    A = P.A.copy()
    for key in P.keys:
        A[key] = numpy.tril(P.A[key])
    return Poly(A, dim=P.dim, shape=P.shape)