|
Yes, those two facts about zero/empty cases (and so many more) are definitely related, and this class of facts is one of my favourites! Usually, if you're dealing with something algebraic in flavour (which is a very vague concept, sorry), there will be a sensible way to define the zero/empty case. This is often a good test of whether you have a uniform concept that works for all n without corner cases. It almost irritates me when I read a book or a paper and they say that the zero/empty case is "by convention". I almost want to yell, "no! it's because that's how you make the definition uniform!" Addition is usually defined as a binary operation, a+b, but really it should be defined as an n-ary operation; associativity tells us that doing "two layers" of addition should boil down to doing a single layer of addition on the concatenated list of operands. That forces 0-ary addition to be zero, which can always be added to the list of operands without affecting the result. Something similar happens with empty products (which explains the factorial), empty spans, etc. In all cases, the trick is to figure out, what is the equivalent of associativity? What "syntactic" operations on the inputs (for example, concatenating a list of lists of operands) correspond to operations on the outputs (you can get the total sum by first computing partial sums)? A fun puzzle, if you enjoy this kind of thing: what's the determinant of the 0x0 matrix (over your favourite field or ring)? For all (square) sizes, the determinant of the zero matrix is zero, but the determinant of the identity matrix is one, and the 0x0 matrix is kind of both. So which pattern should win? Which one is stronger? I know my own answer ;) |