Axis-aligned bounding box 2026-10-14
An axis-aligned bounding box is a Cartesian product of closed intervals aligned with a chosen Cartesian coordinate system:Only the two opposite corners and need to be stored. In two dimensions it is a rectangle. Changing the Cartesian coordinate system can change how tightly the axis-aligned bounding box fits the same object.[ref]
For a nonempty finite set of points , the smallest such axis-aligned bounding box hasThese minimum and maximum values also enclose the convex hull of : each coordinate of a convex combination lies between the smallest and largest input coordinates. In particular, three vertices of a polygon determine the axis-aligned bounding box of a filled triangle. For a general nonempty compact set, the same formulas use all its points; inspecting only an arbitrary finite sample is insufficient.
Given nonempty boxes and , the closed interval convention givesEquivalently, reject as soon as or in any coordinate. The surviving set intersection has endpoints and . This is an exact box test, while its conclusion about enclosed objects remains a conservative enclosure test.[ref]
3.7 Bounding Boxes. §3.7, Intersect() and Overlaps(): coordinate-wise intersection and inclusive comparisons
Equality counts as touching: and share an edge, so their set intersection is nonempty. Replacing every in the overlap formula by tests intersection of the interiors of full-dimensional boxes and excludes this contact. A zero-width closed interval can represent a point or a lower-dimensional enclosure, and must not automatically be discarded when touching counts. A box with some is empty; test emptiness before applying rules intended for nonempty boxes. The broad phase must retain touching candidates whenever the narrow phase counts touching as a hit.
For nonempty boxes, the smallest enclosing axis-aligned bounding box of their set union isThis operation supplies the parent boxes in a bounding volume hierarchy. It is an enclosure of the set union, rather than generally the set union itself. In floating-point arithmetic, comparisons are conclusive only for endpoints that still enclose the intended exact objects; use certified bounds such as interval arithmetic with outward rounding when that guarantee is required.
// Target: analysis.bigb
Boolean operations on events 2026-10-14
Events turn Boolean operations into operations on sets. For a die with sample space , let be the event “even outcome” and the event “outcome at least four”. At outcome , use the indicator functions and . ThenThus logical conjunction becomes set intersection, logical disjunction becomes set union, exclusive or becomes symmetric difference, and logical negation becomes the complement of a set within . Outcome four satisfies both events, so inclusive logical disjunction includes it and exclusive or excludes it. If the die is fair, these four events have probabilities , , , and , respectively. No assumption of independent events is needed for the set identities; indeed and here are not independent, since .
Bounding volume 2026-10-14
A bounding volume is a simple enclosing set for an object : every point of belongs to . Its purpose is to make a cheap rejection possible before examining the object itself. For example, an axis-aligned bounding box can enclose a triangle using just its smallest and largest coordinates.
The guarantee is one-sided. If and , thenThus an empty set intersection of the bounding volumes certifies an empty set intersection of the objects. An overlap of the bounding volumes is necessary for actual intersection, but does not prove it. This is a conservative enclosure test: rejection is conclusive, acceptance means further examination is needed.
Consider the filled triangles with vertices of a polygon and with vertices of a polygon . Their axis-aligned bounding boxes overlap in . Nevertheless, every point of satisfies , whereas every point of satisfies . The two triangles are disjoint. The shaded square in the bounding volume hierarchy illustration makes this false candidate visible.
For collision detection, a broad phase produces possible object pairs from bounding volume tests; a narrow phase examines the actual shapes, for example with a triangle-triangle intersection algorithm. Scott Le Grand's Chapter 32. Broad-Phase Collision Detection with CUDA explains this separation in its opening paragraphs. Whether touching counts as a collision must be specified by the application.
An enclosure must cover the entire object being queried. A box fitted to samples of a parametric curve only guarantees enclosure of the sampled points, unless a separate bound covers the whole parametric curve. For a Bézier curve, the convex hull of its control points provides such a bound on its defining parameter interval. In floating-point arithmetic, outward rounding can preserve certified coordinate bounds; an inward roundoff error can invalidate a rejection. Bounds must also be updated when objects move.
Conservative enclosure test 2026-10-14
A conservative enclosure test may retain disjoint objects as candidates, but must never reject a true set intersection. Increasing an enclosure can add candidates while preserving this implication.
Constructive solid geometry 2026-10-31
Constructive solid geometry describes a solid by combining primitive regions with Boolean set union, set intersection and difference. With primitive defining functions nonpositive inside, minimum implements union and maximum implements intersection. These formulas encode membership rather than signed distance functions. Solid modellers often regularize Boolean operations to remove isolated lower-dimensional remnants.
Continuity into a product space 2026-10-14
For a topological space and topological spaces , a function is continuous into the product topology exactly when every coordinate function is continuous.[ref]
18.901, Fall 2024 lecture notes. Lecture 5, Proposition 5.3.2, printed page 21: continuity into a product is equivalent to continuity of all component functions
Proof outline: one direction uses function composition with the continuous projection maps. For the other, the preimage of a basic cylinder set isa finite set intersection of open sets in . This gives continuity on every basic test. It explains, for example, why from the real line to is continuous in the product topology: each coordinate is a polynomial function. The general coordinate criterion fails for the box topology, where infinitely many preimages can be required at once. For example, has continuous coordinate functions, but the preimage of the box is , which is not an open set in the real line.
Coprime integers Created 2026-09-24 Updated 2026-10-14
Two integers are coprime when their greatest common divisor is one:For positive integers, this says that the only positive common divisor is one. For signed integers, use , with absolute values; changing either sign leaves coprimality unchanged. With the convention , zero is coprime precisely to , because . Both are coprime to every integer. [ref]
https://darijgrinberg.gitlab.io/floor.pdf. Darij Grinberg, MIT 18.781, Section 1.2: greatest common divisors and coprimality
The word concerns shared prime factors, not whether either input is a prime number. For instance and are coprime composite numbers, even though neither is a square-free integer. Conversely, and are square-free integers but are not coprime. Consecutive integers are always coprime: any common divisor of divides their difference one. Thus provide another pair of coprime composite numbers.
For positive integers, let be the prime support of an integer. The equivalent test isThe set intersection of the two prime supports of an integer must be the empty set. Indeed, any positive common divisor greater than one has a prime factor, and any shared prime factor is a common divisor greater than one. Hence coprimality depends on which prime factors occur, rather than on their prime valuations; replacing either input by its radical of an integer preserves coprimality.
For a list of at least two integers, distinguish pairwise coprimality, requiring every pair to be coprime, from joint coprimality, requiring only the greatest common divisor of the entire list to be one. For example,No prime factor belongs to all three prime supports of an integer, yet each pair shares one. By contrast, have pairwise coprimality. The distinction is presented by Poritz under the names pairwise and mutually relatively prime. [ref]
https://math.libretexts.org/Bookshelves/Combinatorics_and_Discrete_Mathematics/Yet_Another_Introductory_Number_Theory_Textbook_-_Cryptology_Emphasis_(Poritz)/01:_Well-Ordering_and_Division/1.05:_The_Greatest_Common_Divisor. Jonathan A. Poritz, Yet Another Introductory Number Theory Textbook, Section 1.5
One use is simplifying fractions. For a fraction with integer entries and , divide its numerator and denominator by to obtain a reduced fraction with coprime entries. For example, since , and uses the same . A further common divisor would make too small, so the reduction is complete. In particular, the reduced fraction for zero is .
Another use is reversible modular arithmetic: for an integer modulus , an integer has a modular inverse precisely when are coprime. The proof outline uses Bézout's identity: makes a modular inverse, and any inverse relation forces every common divisor to divide one. For example, gives , whereas has no modular inverse modulo . Thus coprimality is the exact condition allowing division by a residue in modular arithmetic. [ref]
https://ocw.mit.edu/courses/18-200-principles-of-discrete-applied-mathematics-spring-2024/mit18_200_s24_lec15.pdf. Ankur Moitra, MIT 18.200, Lecture 15, Lemmas 1–2 and modular inverses
Finite-coordinate basis for the product topology Created 2026-10-14 Updated 2026-10-31
For a finite set and open sets for , the setsform a basis of a topology for the product topology. The empty set intersection is . Each basic open set is a cylinder set; all coordinates outside are free. Arbitrary open sets are unions of these basic tests and need not themselves depend on one fixed finite collection of coordinates.[ref]
Point-Set Topology, Chapter 2: Continuous functions. Proposition 2.2.1, Definition 2.2.2 and Remark 2.2.8: finite-coordinate basis and general open subsets
Why finitely many? Any topology making the projection maps continuous must contain their preimages of open sets, and hence finite set intersections of those preimages. Taking arbitrary unions supplies exactly the product topology. Intersecting two basic cylinder sets still restricts only the finite union of their coordinate sets.
List-based set representation 2026-10-31
Represent a finite set by a list of its elements. Allowing repeated elements makes set union cheap by list concatenation; imposing uniqueness requires membership checks. A representation sorted by a total order and containing no duplicates permits set union and set intersection by a simultaneous scan in linear time. These are different representation invariants for the same abstract set.
Open rectangles in a finite product 2026-10-14
On two copies of the real line with their usual topologies, let and . The coordinate projection maps giveThe first two open sets are unbounded strips; their set intersection is an open rectangle. The point passes both coordinate tests, whereas fails the first because the endpoint is excluded.
An open rectangle is the intersection of two coordinate-projection strips
. Dashed boundaries and hollow endpoints are excluded. Arrows at the ends of the strips indicate that the strips continue indefinitely. The final panel projects the interior point onto the two tested intervals. Details.Every point of an open set in the Euclidean plane has such an open rectangle around it inside that open set. Conversely, every open rectangle contains a small Euclidean ball around each of its points. Thus the product topology here is the usual metric topology of the Euclidean plane. With finitely many factors all coordinates may be restricted; on an infinite Cartesian product a basic cylinder set must leave all but finitely many factors free.
| Boundary | Defining function | Outward normal |
|---|
The six vertices of a polygon traverse the boundary counterclockwise. Each displayed normal vector therefore points to the right of the corresponding directed boundary line segment; it need not be a unit vector. The zero level sets are full straight lines, while the actual boundary retains only the appropriate line segments.
The inward corner at prevents using the set intersection of all six half-spaces: that would incorrectly discard the upper-left part of the seat. Instead takeThe last factor permits either or , removing only the upper-right region. Another way to understand the same constructive solid geometry model is as the set union of two convex polygons, obtained by distributing the last set intersection over this set union. Its constructive solid geometry tree has an intersection at the root and a union child for .
Seat profile, six supporting lines with outward normals, and the right child of the initial bounding box
. Details. The tight axis-aligned bounding box is . Bisect vertically at , giving a right child . For a scalar implicit function representing the same constructive solid geometry solid, useWith the convention inside, set intersection corresponds to the maximum, and set union to the minimum. These operations encode membership; is not a signed distance function.
Since every is an affine function, its extreme values on occur at corners. Exact real-arithmetic interval arithmetic gives:
| Function | Range on | , propagated | , propagated |
|---|
Each leaf range is exact, but combining independent intervals forgets that the expressions share . The final enclosure need not be the exact range of . For example, equality would require both , hence , and , hence on , which is impossible. The enclosure is still sufficient for a reliable three-way decision:Here the result is unresolved. This is a real mixed box, rather than only a pessimistic test: is strictly inside, whereas is outside. A zero endpoint alone can also mean contact with the boundary, so equality must not be treated as proof of strict interior or strict exterior. In floating-point arithmetic, certified bounds require outward rounding.
Continue splitting unresolved boxes, normally alternating axes or splitting the longest side. Propagate the interval arithmetic results through the constructive solid geometry tree, discard exterior boxes and stop refining strict interior boxes. In sufficiently small boundary boxes, locate crossings of the active implicit equations with box edges and connect them into boundary line segments. Retain corners and resolve ambiguous multiple crossings by further refinement; here every genuine boundary piece is straight, so its supporting implicit equation allows exact intersection rather than a curved approximation. A maximum boundary-box diagonal gives spatial localization at that scale, provided no boundary components are discarded; corner-sign sampling alone provides no such guarantee.
The tight box saves empty-space work, but it is awkward for extracting facets. Entire boundary line segments, notably , and , lie on the initial box boundary, and lies on the first splitting straight line. A sign-change-only method may have no exterior sample on the other side and lose such pieces; exact zeros also persist through refinement. A slightly padded initial axis-aligned bounding box, together with an explicit rule for boundary-coincident pieces, makes the faceting more robust. The tight box is therefore economical for enclosure but not the best unqualified choice for a simple faceting implementation.
Choose a circular fillet that removes the sharp convex tip at . The unit directions from toward and are and . Therefore the prescribed tangent points areThe circle centre lies on the normal line to through , so . Its radius to must be perpendicular to , whose direction vector is . ThusConsequentlyIndeed . The interior angle is , and the same radius follows from . The selected circular arc runs from to through angles around :The circular arc facing is the rounding; the complementary arc is not part of the boundary.
Define the disk and a half-plane through the chord byBoth satisfy , and . The clipping half-space retains the part away from , while the disk restores the rounded cap. The required local constructive solid geometry tree isOnly the portion of on the side of can be removed. To see the locality, is negative at every original vertex of a polygon except , and vanishes on the two adjacent sides exactly at . In the resulting triangle , the disk keeps the curved cap next to and discards the tip at . A global set intersection with alone would destroy most of the seat. The outward normal vector on the new boundary is ; at it has the same direction as the outward normal vectors of .
The tangent constraints alone do not insist on a circle; other conic sections can give different bulges. For example, a positive-weight rational quadratic Bézier curve with handles has the required tangent directions:Varying changes the bulge while fixing the tangent points; the circular choice has . Once a circular fillet and these two tangent points are chosen, its centre and radius have no remaining freedom. The half-plane sign and arc selection are also essential: reversing them chooses a different retained region. This construction gives matching tangent directions, or first-order geometric continuity, at ; the curvature jumps from zero on each straight side to on the circle.
It filters the first list by membership in the second list, retaining the order and all repetitions of qualifying entries in the first list. For example,
mystery3([3, 1, 3, 2], [3, 4]) returns [3, 3]. Thus it is related to set intersection, but its result is a list and does not discard repeated elements. Past exam of the mathematics course of the University of Cambridge 2006 ia Paper 5 12 Solution Created 2026-09-24 Updated 2026-10-14
For finite sets , the inclusion-exclusion principle statesTo prove it, fix an element in exactly of the sets. If , it contributes to neither side. If , its contribution to the right side isusing the binomial theorem. This is exactly its contribution to the union. Summing over the finite ambient union proves the formula. Equivalently, the proof is an identity of elementwise membership indicators, so no unproved rule for overlapping sets is being assumed.
Now let the ambient set be all permutations, and let be those fixing element . A set intersection of specified events has elements: the specified elements are fixed and the others may be permuted freely. Apply inclusion-exclusion to the complement of the union of these events. There are possible choices of the fixed positions, hence the derangement count isThe term counts the whole ambient set before subtraction; it is not an omitted empty intersection. The formula also gives and .
Dividing by the factorial and using the convergent power series for the exponential function at givesThe alternating-series estimate supplies the explicit error bound . Thus the limiting proportion is established, not merely identified from the first few values.
Past exam of the mathematics course of the University of Cambridge 2008 iii Paper 14 2 Solution Created 2026-10-03 Updated 2026-10-14
Assume first , and write . The sharp nonuniform t-intersecting family bound isWe prove the bound by deriving the needed Kleitman diametric theorem. Identify subsets with binary words, with Hamming distance . Let be the two expressions above. A set family of Hamming diameter at most has size at most , as follows.
First apply downward coordinate compression: delete coordinate from a member only when its deletion is not already present. This preserves size and cannot increase the Hamming diameter. The only possible increased distance would be between a newly lowered member and a retained member containing . The deletion must have belonged to the old set family, or would have been lowered too. The old pair has precisely that increased distance, proving it was already allowed. Repeated downward compressions terminate in a down-set.
Next apply all elementary set shifts with . They preserve size and Hamming diameter. If shifting one member but retaining the other increased their distance, the retained member must contain but not ; its shifted partner was already present, and the old pair with that partner has the same distance. These shifts preserve the down-set property: a subset of a shifted member either was already present or is obtained by shifting its corresponding old subset. For a retained member, a subset cannot disappear, because the shifted partner of that subset is also a subset of the member or of its retained shifted partner. Repeated shifts terminate, since the sum of the selected coordinate labels decreases whenever a change occurs. We now have a shifted down-set of the same size and Hamming diameter.
Split it into sections on :The first section has Hamming diameter at most . We claim the second has Hamming diameter at most . For , downward closure gives . Compare with . Their distance is , so . Choose outside their union. Shiftedness puts in , while is a member of . Their distance is , proving the claim. For this argument forces to be empty.
The induction now giveswhere negative-diameter set families are empty. The equality of the numerical expressions is Pascal's identity. The base case has at most one member. At the boundary , at most one member of each complementary pair is allowed, giving , which equals by binomial symmetry. For the remaining cases , both section bounds belong to smaller-dimensional induction cases. This completes the diametric proof.
For a -intersecting set family,so the theorem applies. For , equality is attained by all sets of size at least , since two such sets intersect in at least elements. For , take all sets of size at least , and also all -sets avoiding one fixed point. Two of these smaller sets intersect in at least points; a smaller and a larger set intersect in at least ; two larger sets intersect in at least . The size of this set family isso it attains the odd bound. If , the full power set is admissible; if , the only admissible set family is empty.
Every maximal 1-intersecting set family attains , for . Such a set family is an up-set, since adding a superset preserves set intersections. It contains and omits the empty set. It contains at most one member of any complementary pair. If neither of two nonempty complements were present, maximality would give a member disjoint from ; upward closure would then include , a contradiction. Thus it chooses precisely one member of each complementary pair, as in maximal intersecting families choose one member of every complementary pair.
Not every maximal 2-intersecting set family attains the bound. On four points, let . This set family has four members and is maximal: every missing set meets its member in at most one point. The sharp bound is , attained by all sets of size at least three. This proves maximal intersection does not imply maximum size.
Past exam of the mathematics course of the University of Cambridge 2008 iii Paper 14 4 Solution Created 2026-10-03 Updated 2026-10-14
Let , with the two copies of the graph vertex set distinguished. In , the diagonal pairs form an independent set of size : for , their adjacency cannot hold in both a graph and its complement graph. There is another such diagonal set in . These two types lie in different components of , so their set union is independent. Thuswhich proves the printed bound.
A stronger complement-pair capacity gain will make the strict inequality transparent. In words of length , choose a pattern of coordinates from and from . Match the th coordinate of the first type with the th of the second type, and put the same graph vertex label in each pair. This gives independent words for each pattern: if two label tuples differ, their differing pair has a nonedge in one of the two complementary graphs. Codes belonging to distinct patterns are mutually nonadjacent, since some coordinate lies in different components of the disjoint set union. ConsequentlyThe inequalities show that its th root tends to two. ThereforeThis strengthens, rather than changes, the bound requested in the PDF.
For a polynomial representation of a graph over a field , choose points and polynomials , where is a finite-dimensional vector space, such thatNo condition is imposed at adjacent pairs. To bound a strong power, put its polynomials in disjoint variable blocks:They lie in a polynomial space canonically identified with , of dimension . For an independent set of words, evaluation of their polynomials at their associated point tuples is a diagonal matrix with nonzero diagonal: distinct words have a nonedge coordinate, which supplies a zero factor. The polynomials in that independent set are therefore linearly independent, since evaluating any linear relation at each tuple forces its corresponding coefficient to be zero. HenceThis is the polynomial form of the Haemers rank bound, proved here by evaluations and tensor products rather than assumed.
For an explicit counterexample, let the graph vertices of be the five-element subsets of . Join distinct exactly when is odd. There are graph vertices. Over , take andAt the diagonal in the field. At a distinct nonedge the set intersection is even, so . These polynomials lie in the twenty-dimensional space spanned by , proving .
Represent the complement graph over , using the same indicator vectors andIts evaluation at is . The diagonal value is modulo three. Distinct nonedges of are edges of , so the set intersection size is one or three. Their evaluations are respectively zero and modulo three. The polynomials belong to the space spanned by the squarefree quadratic monomials , , of dimension . Therefore .
The graph capacity inequalities are real-number bounds regardless of which field supplies the polynomial representation of a graph. Combining them with the stronger set union lower bound givessince . This proves nonadditivity of Shannon capacity for the graph just defined, with both individual upper bounds calculated explicitly.
Take the linear mapIts kernel of a linear map consists of all , and its image of a linear map is the same line:Their set intersection is nonzero and their sum is only one-dimensional. In particular, cannot be written as a sum of one vector from each of these vector subspaces. The nonzero set intersection also prevents an internal direct sum of vector spaces. ThusThe matrix is a nonzero nilpotent matrix; its failure of diagonalizability explains why the preceding result does not apply.
Let be the two input lengths and suppose numeric comparisons cost constant time. The list-based set representation determines which representation invariant each answer must preserve.
For unsorted lists allowing repetition, retain every left-hand occurrence whose value appears on the right for set intersection, and use list concatenation for set union:
interR xs ys = [x | x <- xs, x `elem` ys]
unionR xs ys = xs ++ ysThe resulting lists represent exactly the desired sets; repeated entries are permitted. Membership by sequential search makes
interR take time complexity in the worst case. The list concatenation in unionR costs to build its copied left spine and shares ys; fully enumerating the resulting list costs .For unsorted, duplicate-free inputs, the same intersection keeps uniqueness, while the union retains
xs and appends only right-hand elements absent from xs:interU xs ys = [x | x <- xs, x `elem` ys]
unionU xs ys = xs ++ [y | y <- ys, not (y `elem` xs)]Neither filtered list has internal repetitions, and the filter in
unionU also excludes overlap with xs. Both operations have worst-case time complexity, customarily written when both lengths are positive. Using the original xs for each membership test avoids searching an ever-growing output.interS [] ys = []
interS xs [] = []
interS (x:xs) (y:ys)
| x < y = interS xs (y:ys)
| x > y = interS (x:xs) ys
| otherwise = x : interS xs ys
unionS [] ys = ys
unionS xs [] = xs
unionS (x:xs) (y:ys)
| x < y = x : unionS xs (y:ys)
| x > y = y : unionS (x:xs) ys
| otherwise = x : unionS xs ysWhen , sortedness proves that cannot occur anywhere in the right list, so it can be discarded from the set intersection or immediately emitted to the set union. The symmetric argument handles ; equal heads are consumed together. Each step consumes at least one input head, so both have worst-case time complexity. These bounds assume the sorted representation invariant is already established; sorting arbitrary inputs has its own cost.
| Representation | Set intersection | Set union, including output traversal |
|---|---|---|
| Unsorted, repetitions allowed | ||
| Unsorted, unique | ||
| Sorted, unique |
The commutativity and associativity of set intersection giveEquivalently, part (ii) reduces both sides to removal of the same set union .



