Why does all() return True if the iterable is empty?
The sum of no numbers is 0.<p>The product of no numbers is 1.<p>The union of no areas (sets, …) is the empty area.<p>The intersection of no areas (sets, …) is the universal area.<p>The commonality here, is what element z can you add or remove from a list which won’t change the result?<p>We call the element that makes no change to the result, the “identity element”.<p>For y = sum of {x1,x2, … Xn,  z},<p>We know z must be 0, if it has no impact on y. So the identity element for sum is 0.<p>So if y = sum of {}, we know we can insert the identity element without changing the result, and we know the sum of {0} is 0. The identity element itself.<p><i>So operations applied across lists return that operation’s identity element for an empty list.</i><p>—-<p>Ergo:<p>the identity element of “all” is “true”.<p>The identity element of “any” is “false”.<p>——<p>More fun:<p>The identity element for the resistance sum across parallel resistors, is the infinite ohm resister.<p>The identity element for the vector distance sum of a child making a sequence of jumps is the in-place jump.<p>—-<p>Getting meta with, oh hell, monads:<p>The identity element for C, the concatenation operator over lists, is the empty list {}.<p>Since all lists are concatenations of lists (down to empty &amp; unitary lists), we can view any operation Q over lists also as an operation over the concatenation of lists.<p>So any Q acts like a monad over list concatenation operations.<p>If Q = sum, then it is the monad that transforms concatenations of lists of numbers into the sum of those numbers.<p>If Q = all, then it is the monad that transforms concatenations of lists of truth values to the conjunction of the truth values in those lists.<p>With that view in place, we can see another reason why the identity of any operation Q is Q on an empty list Q{}<p>Because as a monad, Q applies over C, the concatenation of lists. The identity of C is {}, so the identity of Q must be Q{}.<p>Voila!<p>So we really shouldn’t define sum{} as 0, but define 0 as sum{}.<p>“0” is just a symbol. Sum{} is what it <i>is</i>.<p>0 <i>is</i> the sum of nothing.<p><i>So “True” IS the conjunction of nothing. It’s meaning IS all{}. It is the truth of “no requirements”.</i>