Coefficient in lasso regression objective and not in ridge regression As we know, Lasso regression has an objective of the form:
$\min_w \frac{||Xw - y||_2^2}{2n} + \alpha||w||_1,$
and Ridge regression has the form:
$\min_w ||Xw - y||_2^2 + \alpha||w||_2^2.$
My question is - why does the lasso regression objective contain the term $\frac{1}{2n}$ and ridge regression does not? Is there any logic in using mean squared error and not just squared error like in ridge objective?
I understand that this coefficient does not really matter - we can discard it and scale $\alpha$ to $2n\cdot \alpha$, but all the literature contains it so I am curious, if it has some reasoning.
I tried to search for the intuition of this on the internet but haven't found any explanation. Thanks in advance.

Yours do not seem to agree with the usual definitions. For instance, James et al. (2013) An introduction to statistical learning: with applications in R, Springer (see Chap. 6) defines both the lasso and the ridge without dividing by the sample size.
Nevertheless, as you note, such a division is totally irrelevant as far as the estimates are concerned. One reason that I can think of as to why division by $n$ may make sense is when you want to cast your problem as an $M$-estimation, in which you minimize the average of your loss plus the penalty term with respect to your parameter. In this case, you might be interested in studying theoretical properties (e.g. consistency, limiting distribution, etc.). The average loss plus the penalty is typically an $\mathcal{O}(1)$, so under appropriate smoothness conditions, it will have a limiting distribution.
