Example

Settle Gabriel's paint: one slogan, two kinds of paint

Finite volume, infinite area, a coat of fixed thickness, and the point where the horn is narrower than a molecule.

The chapter separates three questions: is the mathematics true under its assumptions, does it describe what we meant, and what supports that correspondence? “You can fill Gabriel’s horn but not paint it” mixes them. This program puts numbers on each part of the slogan.

Run it

Save this as gabriels_paint.py and run it with Python 3.11 or later. It uses the standard library only.

"""Mathematics and the world: Gabriel's horn and the paint (standard library only).

Horn: radius 1/x for x >= 1, rotated about the x-axis. Lengths in metres.
"""
import math

MOLECULE = 1e-9   # a generous size for a paint molecule: 1 nanometre

print("1. True under its assumptions: the two integrals (exact forms)")
for b in (10, 1e3, 1e6, 1e9):
    print(f"  up to x = {b:<8.0e} volume pi(1 - 1/b) = {math.pi * (1 - 1 / b):.9f}   area > 2 pi ln b = {2 * math.pi * math.log(b):8.2f}")

print("\n2. Painting the outside with a coat of fixed thickness d needs at least d * area:")
for d in (1e-3, 1e-6):
    for b in (1e3, 1e9, 1e100):
        print(f"  d = {d:g} m, up to x = {b:<6.0e}: paint > {d * 2 * math.pi * math.log(b):.3e} m^3")
print("  As b grows without bound, so does the paint: any fixed thickness needs infinite paint.")

print("\n3. 'Filling it' coats the inside with paint whose thickness is the radius 1/x:")
x_mol = 1 / MOLECULE
print(f"  the tube is narrower than a molecule beyond x = {x_mol:.0e} m")
print(f"  real paint fills at most the volume up to there: {math.pi * (1 - 1 / x_mol):.9f} m^3 (< pi)")
print("  and cannot reach the rest of the horn, which is infinitely long.")

print("\n4. Mathematical paint: a coat of thickness 1/x over the whole horn has volume pi, finite;")
print("   a coat of any fixed thickness has infinite volume. No contradiction: the slogan's")
print("   'paint' meant two different things.")

Expected outcome

1. True under its assumptions: the two integrals (exact forms)
  up to x = 1e+01    volume pi(1 - 1/b) = 2.827433388   area > 2 pi ln b =    14.47
  up to x = 1e+03    volume pi(1 - 1/b) = 3.138451061   area > 2 pi ln b =    43.40
  up to x = 1e+06    volume pi(1 - 1/b) = 3.141589512   area > 2 pi ln b =    86.81
  up to x = 1e+09    volume pi(1 - 1/b) = 3.141592650   area > 2 pi ln b =   130.21

2. Painting the outside with a coat of fixed thickness d needs at least d * area:
  d = 0.001 m, up to x = 1e+03 : paint > 4.340e-02 m^3
  d = 0.001 m, up to x = 1e+09 : paint > 1.302e-01 m^3
  d = 0.001 m, up to x = 1e+100: paint > 1.447e+00 m^3
  d = 1e-06 m, up to x = 1e+03 : paint > 4.340e-05 m^3
  d = 1e-06 m, up to x = 1e+09 : paint > 1.302e-04 m^3
  d = 1e-06 m, up to x = 1e+100: paint > 1.447e-03 m^3
  As b grows without bound, so does the paint: any fixed thickness needs infinite paint.

3. 'Filling it' coats the inside with paint whose thickness is the radius 1/x:
  the tube is narrower than a molecule beyond x = 1e+09 m
  real paint fills at most the volume up to there: 3.141592650 m^3 (< pi)
  and cannot reach the rest of the horn, which is infinitely long.

4. Mathematical paint: a coat of thickness 1/x over the whole horn has volume pi, finite;
   a coat of any fixed thickness has infinite volume. No contradiction: the slogan's
   'paint' meant two different things.

The volume integral settles on π and the area grows without bound: that is the mathematics. A coat of any fixed thickness needs at least thickness × area, which has no bound. “Filling” coats the inside with paint whose thickness is the radius 1/x, which shrinks below a molecule at x = 10⁹ m. With mathematical paint both halves hold; with real paint both fail. The paradox is in the slogan, not the integrals.

Mechanism and limitations

Documented: Chapter 19 of the book sets out the mathematics; this program is a self-contained demonstration of it, not one of the laboratory’s recorded investigations.

Observed: the output above, produced by running the program exactly as shown.

Not shown:

  • The molecule size (1 nm) is an illustrative assumption, not a measurement.
  • The integrals are taken in their exact forms; Part I, chapter 8 has Lean prove the convergence and divergence.

Related worked example: Chapter 9 .

Challenge this result

Copy this into the AI assistant of your choice, or work through it yourself. Check any finding against the recorded evidence.

Examine the three correspondences in "you can fill it but not paint it":
integral to volume and area, filling to coating, and mathematical paint to
real paint. Say which hold and which do not, with a number for each. Then
propose a mathematical model of real paint under which the slogan becomes a
theorem, or explain why none can.

Chapter: https://programmer.ie/books/math/19-chapter/
Example: https://programmer.ie/examples/math/19-chapter/
Program: https://github.com/ernanhughes/math/blob/main/notebooks/math/programs/19-mathematics-and-world.py
Distinguish what the record shows from what you infer. If you cannot open a link, ask me for the material; do not invent it.

Canonical source and the program .

Understand this example

Copy this prompt into your AI tool. No code runs here.

Apply this example

Copy this prompt into your AI tool. No code runs here.