An integer range is listed, and a family of sets has a union and an intersection - #1435
Conversation
…ntersection Item 4 of the reference's docket (#1409), second half. ZZ /\ [1; 10] lists its members: an integer set cut by a numeric interval with at most 4096 members in it is the finite set of them -- the reference's [n] = {1, ..., n} is ZZ+ /\ [1; n], and its indexed unions run over such ranges; the reals and the complex numbers cut by an interval are the interval, and the rationals stay as written. union(A_k, k in I) and intersection(A_k, k in I), the ⋃ and ⋂ over a family, are Entity.Set.IndexedUnionf and IndexedIntersectionf: binders like sum, with the capture-avoiding substitution a quantifier has, folded to the binary operators over a listed index set, and over any other an object whose membership goes through the quantifiers -- x in union(A_n, n in I) is exists n in I : x in A_n -- so that the reference's limit cases read at their members: 0 in intersection([0; 1/n), n in ZZ+) is True and 0.1 is not, 1 is in every [n] and 2 is not. complement(A, U) is U \ A, a complement being relative to a universe. The reference's rows are the tests (IndexedSetOperationTest): Ex 3.6.1, Ex 3.6.6 over two index sets, Ex 3.5.11, Problem 3.11.20, §3.9.5 Try 8. An index is k or n where the book writes i, which is the imaginary unit here. #1409 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura
|
Do e.g. max / min also want its indexed variant separate from a function of two expressions? If breaking, note for v3 |
|
Today The v3 point is consistency of the indexed spelling across all of them — |
Item 4 of the docket on #1409, second half: the constructions the chapter's exercises are written over — integer ranges, indexed unions and intersections, and the complement relative to a universe. Its rows are the tests.
ZZ /\ [1; 10]lists its members. An integer set cut by a numeric interval with at most 4096 members in it is the finite set of them (SetOperators.IntersectSpecialSetAndInterval, through the residue-class listing of #1424 with modulus 1): the book's[n] = {1, …, n}isZZ+ /\ [1; n],[0; 2.5] /\ ZZ*is{0, 1, 2},ZZ /\ (1; 2)is{}. The reals and the complex numbers cut by an interval are the interval; the rationals stay as written.union(A_k, k in I)andintersection(A_k, k in I)areEntity.Set.IndexedUnionfandIndexedIntersectionf, binders likesum(name bound throughout, capture-avoiding substitution as a quantifier's), under an abstractIndexedSetOperation:union({k, 2 k}, k in ZZ+ /\ [1; 10])is{1, …, 10, 12, 14, 16, 18, 20}(Ex 3.6.1);A_k = {k-2, …, k+2}over{1, 2, 3}unites to{-1, …, 5}and meets in{1, 2, 3}(Ex 3.6.6)x in union(A_n, n in I)isexists n in I : x in A_n. So the book's limit cases read at their members —0 in intersection([0; 1/n), n in ZZ+)isTrueand0.1is not (§3.9.5 Try 8);1is in every[n]and2is not (Problem 3.11.20)The families themselves stay written over an infinite index set (
⋂ [0, 1/n) = {0}as a set equality needs a limit argument, not this PR's).complement(A, U)isU \ A— a complement is relative to a universe, there being no set of everything (Ex 3.5.11). Note thatiis the imaginary unit, so an index iskorn; the parser says so when asked fori.MathS.Sets.IndexedUnion/IndexedIntersection/Complement;union,intersection,complementare keywords now. Syntax.md, BREAKING-CHANGES.md (rows measured on a v2.5.0 build), PublicApi.txt regenerated, parser regenerated and post-processed.IndexedSetOperationTest, 25 rows. Full suite 12160 passed, 0 failed; benchmark gate PASSED (SimplifyHard 173,260,088 B, the same bytes as master after #1432).What is left of item 4 is tuples and Cartesian products, which is #330's question (a pair as a value, a set of pairs) and waits for the v3 design (#1019); the docket moves to item 5, relations.
Part of #1409.
🤖 Generated with Claude Code
https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura