I've recently watched this video and struggle to wrap my mind around difference between codomain and range of a function. I understand that range is a subset of the codomain, but at the same time if there is no any restrictions on how the codomain is defined, why it needs to be defined beyond the range? Is it author of a function who defines the codomain? And if so, what makes him define the codomain beyond the range of a function (as the author, he is supposed to know all possible restrictions).
If it's not "authors" but rather for consumers of a function, who have to deduce the codomain, how can they even approximate the codomain without knowing entire range? And if they know the range, why again codomain needs to be defined beyond range?