Skip to main content

Boxes versus Balls: An Expressiveness Story

📍 Where we are: Part II · Region and Geometric Embeddings — Chapter 7. Beta and Probabilistic Embeddings bought negation by trading regions for densities; before Part II closes, its first two shapes, the ball and the box, must face the operation that started the whole Part: conjunction.

Part II has now assembled three geometries for concepts: balls and cones placed by hand, boxes intersected along query paths, and Beta densities that can negate. This chapter puts the first two head-to-head on a single, decidable criterion. There is no training here, no loss, no gradient: only exact two-dimensional geometry, every claim derived by hand and then verified deterministically on a dense grid by the companion module boxes_vs_balls.py. The verdict is not a benchmark score a better optimizer might overturn next year; it is a closure property of a family of sets, and it is permanent.

The simple version

Imagine two round spotlights on a dark stage, aimed so their circles of light overlap. The doubly lit patch in the middle is shaped like an almond, or a lens. Now the director hands you one spotlight and says: light up exactly the doubly lit patch, nothing more, nothing less. You cannot. A round beam either leaves almond corners in the dark or spills light onto singly lit floor; the almond is simply not a circle. But give the director rectangular masking flags instead of round beams, and the problem vanishes: where two rectangles of light overlap, the overlap is itself a perfect rectangle, so one flag frames it exactly. "Concept AND concept" is the overlap. Rectangles survive AND; circles do not.

What this chapter covers

  • The closure criterion: if concepts are regions and conjunction is intersection, then whether a family of regions is closed under intersection decides, before any learning, whether conjunctive concepts are representable exactly.
  • The lens, derived: two balls of radius 1.5 centered at (0, 0) and (2, 0): the overlap's span on the axis, and the two corner points at (1, ±√1.25), each algebraic step shown.
  • The smallest enclosing ball: a lower bound from the triangle inequality, a containment proof from adding two inequalities, and the grid verification: center (1, 0), radius √1.25 ≈ 1.1180, zero lens points escaping.
  • A false positive by coordinates: the committed point p = (−0.1173, −0.0160), inside the cover, inside ball A, and 2.1174 away from ball B's center; then the area accounting: 60.56 percent of the best covering ball is geometrically wrong.
  • Boxes on the same test: the corner max/min intersection proved exact per coordinate, then confirmed with zero membership mismatches at all 4,000,000 grid points.
  • The parameter ledger: a ball costs d+1 numbers, a box 2d, and the extra d−1 numbers buy d independent interval constraints instead of one isotropic radius.
  • A fair hearing for the ball: rotation invariance, a single scale, smooth gradients; why the practical verdict is task-relative even though the closure fact is absolute.

The criterion: closure under intersection

Recall the reading of concepts that opened this Part. Entities of the academic world are points in Rd\mathbb{R}^d, the space of lists of dd real numbers, where dd is the embedding dimension (throughout this chapter d=2d = 2, so everything can be drawn and checked by eye). A concept such as Student or Professor is a region, a subset of that space, and an entity belongs to the concept exactly when its point falls inside the region. A region family F\mathcal{F} is the set of all regions of one parametric shape: all balls, or all axis-aligned boxes. Every concept the model can ever represent must be drawn from the chosen family.

Volume 2 fixed the meaning of conjunction: the concept CDC \sqcap D (read "C and D") denotes, in every interpretation, the set of individuals belonging to both, the set intersection CIDIC^{\mathcal{I}} \cap D^{\mathcal{I}} (the symbol \cap builds the set of points lying in both operands). So the region of a conjunction is forced: it must be the intersection of the two operand regions. The academic world asks such questions constantly; "students who have authored a paper" is the conjunction Student ⊓ ∃authored.Paper, and answering it geometrically means intersecting two regions [1].

Here is the criterion, stated as a principle. Say F\mathcal{F} is closed under intersection if for every pair of regions X,YFX, Y \in \mathcal{F} (the symbol \in reads "is a member of"), the intersection XYX \cap Y is again a member of F\mathcal{F}. Then:

If concepts are regions drawn from a family F\mathcal{F} and conjunction is intersection, conjunctive concepts are representable exactly for every pair if and only if F\mathcal{F} is closed under intersection.

Both directions are short. If F\mathcal{F} is closed, the true region XYX \cap Y is itself a family member, so the model can store it, intersect it again, and pass it along like any atomic concept; nothing is lost. If F\mathcal{F} is not closed, there exist X,YFX, Y \in \mathcal{F} whose intersection lies outside the family. Whatever region ZFZ \in \mathcal{F} the model substitutes for the conjunction, ZXYZ \neq X \cap Y as sets, so some witness point separates them: either a point in ZZ but not in XYX \cap Y, which the model wrongly calls a member (a false positive), or a point in XYX \cap Y but not in ZZ, which the model wrongly excludes (a false negative). This error exists before any data is seen or any optimizer runs; it is a property of the shape catalogue, not of the training. Closure is exactly why boxes were chosen for conjunctive query answering [1], why box intersection can be treated as the meet of a lattice [2], and why the ontology-embedding work that Part III examines migrated toward boxes [3]. The rest of the chapter makes both verdicts concrete.

Two balls make a lens

Fix the two operand regions once, in coordinates, exactly as boxes_vs_balls.py lines 42–44 declare them. A ball with center c\mathbf{c} and radius rr is the set of points within distance rr of the center, B(c,r)={pR2:pcr}B(\mathbf{c}, r) = \lbrace \mathbf{p} \in \mathbb{R}^2 : \lVert \mathbf{p} - \mathbf{c} \rVert \le r \rbrace, where the double bars \lVert \cdot \rVert denote Euclidean length, the square root of the sum of squared components. Our two balls are

A=B((0,0),1.5),B=B((2,0),1.5),A = B\big((0, 0),\, 1.5\big), \qquad B = B\big((2, 0),\, 1.5\big),

so a point (x,y)(x, y) belongs to AA when x2+y22.25x^2 + y^2 \le 2.25 and to BB when (x2)2+y22.25(x - 2)^2 + y^2 \le 2.25, with 2.25=1.522.25 = 1.5^2 (squaring both sides of the distance condition removes the square root without changing the set, because both sides are non-negative).

First, the overlap's extent along the axis through the two centers, the line y=0y = 0. Membership in AA there requires x22.25x^2 \le 2.25; taking square roots of both sides, and remembering that both signs satisfy a squared bound, gives 1.5x1.5-1.5 \le x \le 1.5. Membership in BB requires (x2)22.25(x - 2)^2 \le 2.25, which is 1.5x21.5-1.5 \le x - 2 \le 1.5, and adding 22 to all three parts gives 0.5x3.50.5 \le x \le 3.5. A point of the intersection must satisfy both chains at once, so on the axis the overlap spans

0.5    x    1.5,0.5 \;\le\; x \;\le\; 1.5,

the interval the module stores as LENS_X_MIN and LENS_X_MAX (boxes_vs_balls.py lines 49–50).

Second, the points where the two boundary circles cross. On the boundaries the inequalities become equalities: x2+y2=2.25x^2 + y^2 = 2.25 and (x2)2+y2=2.25(x - 2)^2 + y^2 = 2.25. Subtract the second equation from the first; the y2y^2 terms cancel:

x2(x2)2=0.x^2 - (x - 2)^2 = 0.

Expanding (x2)2=x24x+4(x - 2)^2 = x^2 - 4x + 4 and substituting,

x2x2+4x4  =  4x4  =  0x=1.x^2 - x^2 + 4x - 4 \;=\; 4x - 4 \;=\; 0 \quad\Longrightarrow\quad x = 1.

Back-substituting x=1x = 1 into x2+y2=2.25x^2 + y^2 = 2.25 gives y2=2.251=1.25y^2 = 2.25 - 1 = 1.25, so y=±1.25±1.1180y = \pm\sqrt{1.25} \approx \pm 1.1180 (boxes_vs_balls.py lines 55–56). Call these two corner points q+=(1,+1.25)q_+ = (1, +\sqrt{1.25}) and q=(1,1.25)q_- = (1, -\sqrt{1.25}). Each lies at distance 12+1.25=2.25=1.5\sqrt{1^2 + 1.25} = \sqrt{2.25} = 1.5 from both centers, exactly on both boundary circles, so both belong to the closed intersection.

The intersection ABA \cap B is the lens: a convex region bounded by two circular arcs of radius 1.51.5 meeting at the corners q+q_+ and qq_-. And a lens is not a ball: informally, its boundary has two corners where arcs meet at an angle, while a circle bends smoothly everywhere; a watertight version of the argument, by area, arrives two sections below. The committed run prints the derived geometry verbatim:

1. two balls and their lens
A = ball((0.0, 0.0), r = 1.5) B = ball((2.0, 0.0), r = 1.5)
lens spans x ∈ [0.50, 1.50] on the axis; boundaries cross at (1.0, ±1.1180)
smallest enclosing ball: center (1.0, 0.0), radius √1.25 = 1.1180
grid check (2000×2000): lens points escaping the ball = 0
farthest lens point from the center: 1.1175 (= radius 1.1180 — the crossing points are diameter ends)

The smallest ball that covers the lens

A ball-based model asked to represent ABA \sqcap B must answer with a ball. The most charitable choice for recall is the smallest ball containing the whole lens, so that no genuine member of the conjunction is excluded. That ball can be found exactly, in two steps: a lower bound on the radius, and a matching construction.

The lower bound. Suppose some ball B(c,r)B(\mathbf{c}, r) contains the lens. It then contains both corners q+q_+ and qq_-. The triangle inequality states that for any three points the direct distance between two of them is at most the sum of the distances through the third; applied to q+q_+, c\mathbf{c}, qq_-:

q+q    q+c+cq    r+r  =  2r.\lVert q_+ - q_- \rVert \;\le\; \lVert q_+ - \mathbf{c} \rVert + \lVert \mathbf{c} - q_- \rVert \;\le\; r + r \;=\; 2r.

The corners share the coordinate x=1x = 1, so their distance is the difference of their heights, q+q=21.25\lVert q_+ - q_- \rVert = 2\sqrt{1.25}. Substituting, 21.252r2\sqrt{1.25} \le 2r, hence r1.25r \ge \sqrt{1.25}. No ball of radius under 1.251.1180\sqrt{1.25} \approx 1.1180 can cover the lens.

The construction. The bound is achieved by the ball centered at the corners' midpoint, (1,0)(1, 0), with radius exactly 1.25\sqrt{1.25}, and the proof that it contains the entire lens is three lines of algebra. Let (x,y)(x, y) be any lens point, so both membership inequalities hold:

x2+y2    2.25andx24x+4+y2    2.25,x^2 + y^2 \;\le\; 2.25 \qquad\text{and}\qquad x^2 - 4x + 4 + y^2 \;\le\; 2.25,

the second being (x2)2+y22.25(x-2)^2 + y^2 \le 2.25 with the square expanded. Add the two inequalities term by term:

2x24x+4+2y2    4.5.2x^2 - 4x + 4 + 2y^2 \;\le\; 4.5.

Divide every term by 22:

x22x+2+y2    2.25.x^2 - 2x + 2 + y^2 \;\le\; 2.25.

Complete the square in xx: since x22x+1=(x1)2x^2 - 2x + 1 = (x - 1)^2, the left side is (x1)2+1+y2(x-1)^2 + 1 + y^2, and subtracting 11 from both sides gives

(x1)2+y2    1.25.(x - 1)^2 + y^2 \;\le\; 1.25.

That is precisely the statement "the point lies within distance 1.25\sqrt{1.25} of (1,0)(1, 0)." Every lens point satisfies it, so the ball B((1,0),1.25)B\big((1,0), \sqrt{1.25}\big) contains the lens; by the lower bound no smaller ball does; therefore it is the smallest enclosing ball, and q+q_+, qq_- are the two ends of one of its diameters (boxes_vs_balls.py lines 65–66). Note where the slack went: equality in the sum requires equality in both operand inequalities at once, which happens only at the two corners, so every other lens point sits strictly inside the cover. That is the first hint the cover is loose.

The module then verifies the construction numerically. It lays a 2000×20002000 \times 2000 grid of cell centers over the cover's bounding square (centers rather than lattice corners, so no sample sits exactly on a region boundary; boxes_vs_balls.py lines 102–110), evaluates all three memberships at all 4,000,0004{,}000{,}000 points, and counts lens points that escape the cover (boxes_vs_balls.py lines 149–158):

X, Y, cell = _cell_grid(BEST_CENTER[0] - r, BEST_CENTER[0] + r, -r, r)
in_a = _sq_dist(X, Y, CENTER_A) <= RADIUS ** 2
in_b = _sq_dist(X, Y, CENTER_B) <= RADIUS ** 2
lens = in_a & in_b # membership in A ∩ B
ball = _sq_dist(X, Y, BEST_CENTER) <= r ** 2 # membership in best ball
lens_cnt, ball_cnt = int(lens.sum()), int(ball.sum())
lens_area_grid = lens_cnt * cell
ball_area_grid = ball_cnt * cell
escaped = int(np.count_nonzero(lens & ~ball)) # lens points outside ball
max_dist = float(np.sqrt(_sq_dist(X, Y, BEST_CENTER)[lens].max()))

The run reports escaped = 0: not one of the millions of lens samples falls outside the cover, matching the containment proof. It also reports the farthest lens sample at distance 1.11751.1175 from the center, half a grid cell short of the radius 1.11801.1180: the grid spans 21.252.23612\sqrt{1.25} \approx 2.2361 across 20002000 cells, about 0.00110.0011 per cell, and cell centers cannot land exactly on the corner points, so a gap of 0.00050.0005 is the expected discretization. The competency assert at line 192 demands both facts, so the enclosure is real and tight.

The false positive, by name

The cover contains the lens. The question with teeth is what else it contains, because every extra point is an entity the ball model must call a member of ABA \sqcap B although the conjunction's semantics excludes it. The module hunts for the worst such point with a seeded search: 20,00020{,}000 uniform samples in the cover's bounding square, filtered to those inside the cover, taking the one that violates the lens condition by the largest margin (boxes_vs_balls.py lines 164–174):

rng = np.random.default_rng(0)
pts = rng.uniform([BEST_CENTER[0] - r, -r], [BEST_CENTER[0] + r, r],
size=(20_000, 2))
d_a = np.sqrt((pts[:, 0] - CENTER_A[0]) ** 2 + (pts[:, 1] - CENTER_A[1]) ** 2)
d_b = np.sqrt((pts[:, 0] - CENTER_B[0]) ** 2 + (pts[:, 1] - CENTER_B[1]) ** 2)
d_c = np.sqrt((pts[:, 0] - BEST_CENTER[0]) ** 2 + (pts[:, 1] - BEST_CENTER[1]) ** 2)
violation = np.maximum(d_a, d_b) - RADIUS # > 0 ⟺ outside the lens
violation[d_c > r] = -np.inf # keep only points inside the ball
i = int(np.argmax(violation))
fp: Point = (float(pts[i, 0]), float(pts[i, 1]))
fp_da, fp_db, fp_dc = float(d_a[i]), float(d_b[i]), float(d_c[i])

The violation line encodes lens membership in one expression: a point belongs to the lens exactly when its distance to both centers is at most 1.51.5, that is, when the larger of the two distances is at most 1.51.5, so a positive max(dA,dB)1.5\max(d_A, d_B) - 1.5 certifies non-membership. Because the generator is seeded (default_rng(0)), every run finds the identical point, printed with its three distances:

2. the ball's false positives (the price of forcing a lens into a ball)
exhibit p = (-0.1173, -0.0160) [seeded search, rng(0), 20000 samples]
|p − c_A| = 0.1184 vs 1.5 → inside A
|p − c_B| = 2.1174 vs 1.5 → OUTSIDE B ⇒ p ∉ lens A ∩ B
|p − c_ball| = 1.1174 vs 1.1180 → inside the enclosing ball
areas analytic | grid
lens A ∩ B 1.5487 | 1.5487
best ball 3.9270 | 3.9271
false-positive fraction (ball − lens)/ball = 0.6056 | 0.6056

Read the three lines as a small indictment. The point p=(0.1173,0.0160)p = (-0.1173, -0.0160) sits a mere 0.11840.1184 from ball AA's center, deep inside AA. It sits 2.11742.1174 from ball BB's center, far beyond BB's radius of 1.51.5; it fails one operand of the conjunction outright, so it is not in the lens. Yet its distance to the cover's center is 1.11741.1174, just inside the cover's radius 1.11801.1180, so the ball model asserts pABp \in A \sqcap B. The search converged to the cover's western rim, near x=11.250.118x = 1 - \sqrt{1.25} \approx -0.118, the part of the cover farthest from BB's center, where the violation is largest. The assert at line 189 pins the certificate: inside the cover, outside an operand ball.

The price in area: 60.56 percent

One named point proves existence; the honest measure of the failure is how much of the cover is wrong. Both areas can be computed exactly, and the derivation is a nice piece of circle geometry, so we work it in full.

The chord x=1x = 1 splits the lens into two mirror-image halves. On the far side of the chord, membership in AA already implies membership in BB: a point with x1x \ge 1 satisfies (x2)2x2(x-2)^2 \le x^2, because expanding gives 4x+40-4x + 4 \le 0, which is exactly x1x \ge 1; so its distance to BB's center is at most its distance to AA's center, and being in AA puts that distance at 1.51.5 or less. The half-lens right of the chord is therefore precisely the circular segment of AA beyond x=1x = 1, and by the reflection symmetry of the whole configuration about the line x=1x = 1, the left half is a congruent segment of BB.

A segment's area is a sector minus a triangle. The radius of AA drawn to the corner q+=(1,1.25)q_+ = (1, \sqrt{1.25}) has length 1.51.5 and horizontal component 11, so the angle α\alpha it makes with the positive xx-axis satisfies cosα=1/1.5=2/3\cos\alpha = 1/1.5 = 2/3 (adjacent over hypotenuse). Thus α=arccos(2/3)0.841069\alpha = \arccos(2/3) \approx 0.841069 radians, where arccos\arccos is the inverse cosine, the angle whose cosine is the given value. The sector of AA swept from angle α-\alpha to +α+\alpha is the fraction 2α2π\tfrac{2\alpha}{2\pi} of the full disk of area πr2\pi r^2:

sector  =  2α2ππr2  =  αr2  =  0.841069×2.25    1.89240,\text{sector} \;=\; \frac{2\alpha}{2\pi}\,\pi r^2 \;=\; \alpha\, r^2 \;=\; 0.841069 \times 2.25 \;\approx\; 1.89240,

where α\alpha is carried unrounded through the product (rounding it to four decimals first would drift the last shown digit). The triangle with vertices at AA's center, q+q_+, and qq_- has base the chord between the corners, of length 21.252.23612\sqrt{1.25} \approx 2.2361, and height the distance from the center to the chord, which is 11:

triangle  =  12×21.25×1  =  1.25    1.11803.\text{triangle} \;=\; \tfrac{1}{2} \times 2\sqrt{1.25} \times 1 \;=\; \sqrt{1.25} \;\approx\; 1.11803.

Subtracting, the segment has area 1.892401.11803=0.774371.89240 - 1.11803 = 0.77437, and the lens is two such segments:

area(AB)  =  2×0.77437  =  1.54874    1.5487.\text{area}(A \cap B) \;=\; 2 \times 0.77437 \;=\; 1.54874 \;\approx\; 1.5487.

This matches the closed form the module computes at lines 71–74, 2r2arccos ⁣(d2r)d24r2d22r^2 \arccos\!\big(\tfrac{d}{2r}\big) - \tfrac{d}{2}\sqrt{4r^2 - d^2} with r=1.5r = 1.5 and center distance d=2d = 2. The cover's area is π×(1.25)2=π×1.25=3.9270\pi \times (\sqrt{1.25})^2 = \pi \times 1.25 = 3.9270. The false-positive fraction of the cover, the share of its area lying outside the lens, is therefore

11.54873.9270  =  10.3944  =  0.6056.1 - \frac{1.5487}{3.9270} \;=\; 1 - 0.3944 \;=\; 0.6056.
quantityanalyticdense grid (4,000,000 cell centers)
lens ABA \cap B area1.54871.54871.54871.5487
smallest enclosing ball area3.92703.92703.92713.9271
false-positive fraction0.60560.60560.60560.6056

The grid column is computed by counting cells (areas at lines 154–156, the fraction at lines 176–179), the analytic column by the formulas above, and they agree to within one unit in the last printed digit (the best-ball row reads 3.92703.9270 against 3.92713.9271); the asserts at lines 195–198 require agreement within 0.010.01 and the bound 0.50.5 on the fraction. More than three fifths of the best possible ball is geometrically false, and "best possible" is doing real work: any ball covering the lens has radius at least 1.25\sqrt{1.25}, hence area at least 3.92703.9270, hence false-positive area at least 3.92701.5487=2.37833.9270 - 1.5487 = 2.3783; a trained model with a sloppier cover only does worse. Shrinking the ball to fit inside the lens merely converts the guaranteed error into false negatives. Because the lens is not a ball, some error of one kind or the other is unavoidable; that is the first section's criterion, now carrying numbers. The area accounting also redeems the promise made when the lens was first drawn: were the lens itself a ball, it would be a ball containing the lens, so by the lower bound its radius would be at least 1.25\sqrt{1.25} and its area at least 3.92703.9270; its actual area is 1.54871.5487, so the lens is not a ball.

Two-panel comparison of region families under conjunction. Left panel: two overlapping circles labeled A and B, radius 1.5, centered at the origin and two units to its right; their almond-shaped overlap, the lens, is shaded, with the two corner points marked at height plus and minus 1.118 above and below the point where x equals 1. A dashed circle centered at that midpoint with radius 1.118, the smallest enclosing ball, covers the lens along with a large surrounding area shaded as false positives; the exhibited false-positive point p at coordinates minus 0.1173 and minus 0.0160 is marked near the dashed circle&#39;s left rim, inside circle A but far outside circle B, and a label reports the false-positive fraction 0.6056. Right panel: two overlapping axis-aligned rectangles labeled A prime and B prime; their overlap is itself a rectangle, shaded exactly, annotated with the corner arithmetic that takes the maximum of lower corners and minimum of upper corners, and a label reports zero membership mismatches on the four-million-point grid. A footer contrasts the two families: balls are not closed under intersection, boxes are. The same conjunction, two geometries: the best ball covering the lens A ∩ B is 60.56 percent false positive by area, while the box intersection A′ ∩ B′ is exact at every one of four million grid points. Original diagram by the authors, created with AI assistance.

Boxes pass the same test, exactly

Now run the identical test on the other family. An axis-aligned box in Rd\mathbb{R}^d is a product of intervals, one per coordinate: a point p\mathbf{p} belongs to the box with lower corner lo\mathbf{lo} and upper corner hi\mathbf{hi} exactly when loipihiilo_i \le p_i \le hi_i for every coordinate index ii from 11 to dd. The test boxes are A=[1.5,1.5]×[1.0,1.0]A' = [-1.5, 1.5] \times [-1.0, 1.0] and B=[0.5,3.5]×[1.0,1.0]B' = [0.5, 3.5] \times [-1.0, 1.0] (the ×\times is the set product: first coordinate from the first interval, second from the second), chosen so their overlap spans the same interval [0.5,1.5][0.5, 1.5] on the xx-axis as the lens did.

The closure claim is that the intersection of two boxes is again a box, computable by corner arithmetic: the coordinatewise maximum of the lower corners and minimum of the upper corners. The proof is one equivalence per coordinate. For real numbers uu, aa, bb, where max(a,b)\max(a, b) denotes the larger of aa and bb:

ua   and   ubumax(a,b).u \ge a \;\text{ and }\; u \ge b \quad\Longleftrightarrow\quad u \ge \max(a, b).

Left to right: uu is at least both numbers, in particular at least whichever is larger, and the larger one is max(a,b)\max(a, b). Right to left: max(a,b)\max(a, b) is itself at least aa and at least bb, so umax(a,b)u \ge \max(a, b) gives uau \ge a and ubu \ge b by transitivity of \ge (a number at least a second, which is at least a third, is at least the third). The mirror-image equivalence holds for upper bounds with min\min, the smaller of two numbers. Applying both in every coordinate ii: a point lies in ABA' \cap B' exactly when, for each ii,

max ⁣(ailo,bilo)    pi    min ⁣(aihi,bihi),\max\!\big(a^{lo}_i,\, b^{lo}_i\big) \;\le\; p_i \;\le\; \min\!\big(a^{hi}_i,\, b^{hi}_i\big),

which is verbatim the membership condition of a box with those corners. If in some coordinate the max of lows exceeds the min of highs, the interval is empty and so is the intersection, which the family still represents (an empty box); in lattice terms, intersection is the meet and the empty box is the bottom element [2]. The implementation is the proof transcribed, two comparisons per coordinate, so the running time is proportional to dd for a dd-dimensional implementation; the committed 2-D version spells out both coordinates (boxes_vs_balls.py lines 84–93):

def box_intersection(a: Box, b: Box) -> Box:
"""The intersection of two axis-aligned boxes, computed in O(d).

A point p satisfies a_lo ≤ p ≤ a_hi AND b_lo ≤ p ≤ b_hi exactly when
max(a_lo, b_lo) ≤ p ≤ min(a_hi, b_hi), coordinate by coordinate — so the
intersection IS a box (possibly empty), with no approximation at all.
"""
lo = (max(a[0][0], b[0][0]), max(a[0][1], b[0][1]))
hi = (min(a[1][0], b[1][0]), min(a[1][1], b[1][1]))
return (lo, hi)

On the test pair: lower corner (max(1.5,0.5),max(1.0,1.0))=(0.5,1.0)(\max(-1.5, 0.5), \max(-1.0, -1.0)) = (0.5, -1.0), upper corner (min(1.5,3.5),min(1.0,1.0))=(1.5,1.0)(\min(1.5, 3.5), \min(1.0, 1.0)) = (1.5, 1.0), so AB=[0.5,1.5]×[1.0,1.0]A' \cap B' = [0.5, 1.5] \times [-1.0, 1.0]: a box, with no approximation step anywhere. The module then applies the same dense-grid discipline as before, testing at every one of the 2000×20002000 \times 2000 cell centers of the union's bounding box whether membership in the computed intersection box equals the conjunction "in AA' AND in BB'" (boxes_vs_balls.py lines 182–185):

ibox = box_intersection(BOX_A, BOX_B)
Xb, Yb, _ = _cell_grid(BOX_A[0][0], BOX_B[1][0], BOX_A[0][1], BOX_A[1][1])
mismatches = int(np.count_nonzero(
_in_box(Xb, Yb, ibox) != (_in_box(Xb, Yb, BOX_A) & _in_box(Xb, Yb, BOX_B))))
3. boxes: intersection by corner arithmetic IS a box
A′ = [-1.5, 1.5] × [-1.0, 1.0]
B′ = [0.5, 3.5] × [-1.0, 1.0]
A′ ∩ B′ = [max lows, min highs] = [0.5, 1.5] × [-1.0, 1.0]
grid check (2000×2000 over the union's bounding box): membership mismatches = 0

Zero mismatches at four million points, guarded by the assert at line 200. Be precise about what the grid establishes: the mathematics was settled by the per-coordinate equivalence, which quantifies over all points; the grid verifies that the implementation realizes the theorem, the same role the oracle checks played for Volume 2's completion rules. Where the ball's report card read "0.6056 of the cover is false," the box's reads "0 of anything is false." That asymmetry is the expressiveness story of the chapter's title, and it is why multi-hop query engines chose boxes for conjunction [1]; an engine that uses the exact corner intersection compounds no geometric error when it chains conjunctions.

The parameter ledger in d dimensions

The comparison so far lived in the plane; the families are defined in any dimension, and counting parameters explains both the box's power and its cost. A ball in Rd\mathbb{R}^d is a center, dd numbers, plus a single radius applied isotropically, the same extent in every direction: d+1d + 1 parameters. A box is a center plus a separate half-width per dimension (equivalently, a lower and an upper corner): 2d2d parameters (boxes_vs_balls.py lines 124–129):

def param_counts(d: int) -> tuple[int, int]:
"""(ball, box) parameter counts in ℝ^d. A ball is a center (d numbers)
plus ONE isotropic radius — the same extent in every direction — for
d + 1 parameters; a box is a center plus a per-dimension half-width, 2d
parameters, i.e. d independent interval constraints."""
return d + 1, 2 * d
dimension ddball: d+1d + 1box: 2d2dwhat the box's extra d1d - 1 numbers buy
2233442 independent interval constraints (a ball has 1 radius)
16161717323216 independent interval constraints
6464656512812864 independent interval constraints

The right column is the real content. A box is a conjunction of dd independent one-dimensional constraints: coordinate 1 within this interval, AND coordinate 2 within that one, each interval set separately. If the model's coordinates come to encode attributes, a box can carve "seniority between here and there, AND paper count above this line, AND anything at all elsewhere" by widening the uninformative intervals. A ball can express none of that structure: its single inequality pcr\lVert \mathbf{p} - \mathbf{c} \rVert \le r couples all coordinates into one aggregate distance, so it can only say "near this prototype, uniformly in every direction." The same per-coordinate independence powers the box calculus for relational patterns, where translated and resized boxes capture inference rules that point embeddings provably cannot [4]. At d=64d = 64 the box pays 128128 numbers against the ball's 6565, roughly double the memory per concept; exact conjunction is what the doubled budget purchases.

A fair hearing for the ball

The verdict above is one-sided because the criterion is one-sided, so honesty requires the other column of the ledger. Balls hold real advantages. They are rotation invariant: membership depends only on the distance pc\lVert \mathbf{p} - \mathbf{c} \rVert, which no rotation of the space about the center changes, so a ball model privileges no coordinate direction. Boxes are welded to the axes: rotate a box by 45 degrees and the result is a diamond no box can represent, and a boundary that correlates coordinates, such as "coordinate one at most coordinate two," is invisible to the family. Axis-alignment is a modeling bias, a silent bet that the learned basis will line up with meaningful directions, and nothing in the training objective enforces the bet. Balls also carry a single interpretable scale, cost as few parameters as any practical region family, and are kind to gradient descent: the signed distance pcr\lVert \mathbf{p} - \mathbf{c} \rVert - r is smooth everywhere except the center, supplying informative gradients from any direction of approach. Hard box membership is a flat indicator with kinks along faces and corners, and disjoint boxes yield zero gradient entirely, a failure that pushed the literature toward smoothed and probabilistic box variants [2].

So the practical verdict is task-relative: a task dominated by "near this prototype" structure, indifferent to conjunctions, may be served better by balls at half the cost. But the closure argument is not task-relative, not empirical, and not repealable by a better optimizer. The intersection of two balls is not a ball; the best ball covering our lens is 60.56 percent false by area; the intersection of two boxes is a box, with error exactly zero. Choosing a region family means choosing, in advance, which logical operations your geometry can perform without lying.

The unsolved part

Everything in this chapter was placed by hand, and that is both its strength and its honest limit. The strength: the false positive at (0.1173,0.0160)(-0.1173, -0.0160) is a theorem about the family, a floor under every ball model, unbeatable by any amount of training. The limit: the chapter does not say how much this floor hurts in practice. When a real objective trains balls against a real ontology, radii stretch and centers drift under many competing constraints, and the conjunction error might be swamped by ordinary learning error, masked by slack in high dimensions, or surface exactly where the geometry predicts. Volume 2's normalized TBox makes the question concrete: its NF2 axioms have the shape A1A2BA_1 \sqcap A_2 \sqsubseteq B (the \sqsubseteq reads "is subsumed by": every member of the conjunction is a member of BB), so a geometry that cannot represent A1A2A_1 \sqcap A_2 exactly must approximate the very region whose containment in BB the axiom asserts. Whether that forced approximation shows up as measurable unsoundness in a learned embedding is an empirical question this chapter can only predict, not settle. And the criterion cuts both ways going forward: boxes are closed under intersection but not under union, complement, or rotation, so no family met so far is closed under every constructor a logic might demand [3]. Closure is a per-operator property; picking a geometry means picking which operators come exact, and where that frontier can be pushed is an open design problem of the field.

Why it matters

This chapter is the hinge on which Part II turns into Part III. The neuro-symbolic programme needs geometric or differentiable counterparts for logical operators, and it needs them to obey the operators' laws, not merely gesture at them; closure under intersection is the first such law, and it is checkable with circle geometry and a grid. Conjunctive query answering in vector space chose boxes because the family is closed under intersection [1]; with the exact corner intersection (the specification the published system's learned intersection operator approximates), chaining conjunctions compounds no geometric error. The soundness arguments of ontology embedding, where reaching zero loss is supposed to certify that the geometry is a genuine model of the axioms, lean on the region family being able to represent what the axioms demand at all; that is the closure argument carried into Part III's subject matter [3]. And the method here, state an algebraic law and test a geometry against it deterministically with committed numbers, is the probe template the rest of this volume applies to trained models. When Volume 4 makes logic differentiable, the same discipline returns at larger scale: every soft operator owes its hard counterpart an account of which laws it preserves and which it quietly breaks.

Key terms

  • Region family — all regions of one parametric shape (all balls, all boxes); every representable concept must be drawn from it.
  • Closure under intersection — intersecting any two family members yields another family member; holds for boxes (corner arithmetic), fails for balls (the lens).
  • Lens — the intersection of two overlapping balls: a convex region bounded by two circular arcs meeting at two corners; not a ball.
  • Smallest enclosing ball — the minimum-radius ball containing a region; for our lens, center (1,0)(1, 0) and radius 1.251.1180\sqrt{1.25} \approx 1.1180, minimal by the triangle inequality, containing by summed inequalities.
  • Geometric false positive — a point a family is forced to misclassify before any training, by the gap between a true region and its best family approximation; exhibited at (0.1173,0.0160)(-0.1173, -0.0160), with a 0.60560.6056 area fraction.
  • Circular segment — the region of a disk beyond a chord; area = sector − triangle = r2arccos(h/r)hr2h2r^2\arccos(h/r) - h\sqrt{r^2 - h^2} for chord distance hh; two make the lens.
  • Corner arithmetic — box intersection by coordinatewise max of lower corners and min of upper corners; exact, linear in the dimension.
  • Isotropy — the ball's one-radius-fits-all-directions property: rotation invariance and a single scale, at the price of no per-coordinate structure.
  • Parameter counts d+1d+1 versus 2d2d — ball versus box cost in Rd\mathbb{R}^d; the box's extra d1d - 1 numbers buy dd independent interval constraints.

Where this leads

This chapter placed its regions by hand and proved what the shapes can and cannot do. The next chapter, EL Embeddings, hands the placement to gradient descent: the ELEm construction turns each normal form of Volume 2's real TBox into a geometric loss over balls, with NF1 demanding ball containment, NF3 and NF4 routing existentials through per-role translations, disjointness pushing balls apart, and NF2, conjunction, asking balls for precisely what this chapter proved they cannot deliver exactly. Training reaches a low but nonzero loss, and then the probing begins: over all ordered pairs of satisfiable concepts, does the learned geometry reproduce Volume 2's eight entailed subsumptions and nothing else? This chapter has filed its prediction about where the geometry will bend; the next one runs the experiment.


Companion code: examples/neural/boxes_vs_balls.py contains every construction in this chapter: the lens constants and their derivations in comments (lines 42–74), the corner-arithmetic intersection (lines 84–93), the cell-center grid (lines 102–110), the parameter counts (lines 124–129), and the full verification with its competency asserts (lines 135–200). Run python3 examples/neural/boxes_vs_balls.py to reproduce every number quoted here, byte for byte; the run ends with SUMMARY boxes_vs_balls: ball_radius=1.1180 fp_point=(-0.1173,-0.0160) fp_ratio=0.6056 lens_area=1.5487 ball_area=3.9270 box_mismatches=0.