So I found some similarities between arrays and set notation while learning about sets and sequences in precalc e.g. set notation: {a | cond } = { a1, a2, a3, a4, …, an} given that n is the domain (or index) of the array, a subset of Natural numbers (or unsigned integer). Most programming languages would provide similar methods to arrays that are applied to sets e.g. upperbounds & lowerbounds; possibly suprema and infima too.
Where did arrays come from?
Python’s list comprehensions, in this respect, are as good as it gets:
Very “set-like”. The
for x in <...>part specifies which set the elements are selected from, andif x...specifies the condition.