News for hackers. Stuff that matters.
Re:Types versus sets in math and programming languages by vkazanov on Sunday July 25, 2021 @08:05AM (#27948544)
My math is shallow at best but... 1∪2 would become just 2 with integers represented as sets in certain foundational theories, right?
Re:Types versus sets in math and programming languages by Spivak on Sunday July 25, 2021 @12:50PM (#27950694)
Yep! But notation depends a lot on the author to some extent. You will find people who treat 1U2 as {1}U{2} because it’s less annoying to write.

It’s the same reason languages have an .add method on sets so you don’t have to write.

    s = s.union(set(s))
Re:Types versus sets in math and programming languages by alisonkisk on Sunday July 25, 2021 @06:57PM (#27953721)
who writes 1U2 instead of {1,2} ?

When would {1}U{2} ever appear in ant context except for the first day of Intro to Set Theory?

Re:Types versus sets in math and programming languages by jdmichal on Monday July 26, 2021 @08:49PM (#27967351)
I assume 1 and 2 are placeholders here... Not literally meant.
Re:Types versus sets in math and programming languages by hansvm on Sunday July 25, 2021 @08:46AM (#27948768)
Yes. One common definition is equivalent to each natural to being the set containing all preceding naturals. With that view 2={0,1} and 1={0}, so their union is just 2.