Book VII · Proposition 31

VII.31

Any composite number is measured by some prime number.Heath, 1908

Every step, checked

What it needs, and what needs it

Needs: nothing earlier.

Used by: VII.32 IX.20

Rests on: Def.VII.3

Depth: 0 steps of argument above the first principles. Parallel postulate: not needed.

What it takes on trust

Nothing. It draws no intersections and reads nothing off the picture.

The proposition as code

@proposition(
    "VII.31",
    THEOREM,
    sample=lambda rng: (rng.randint(4, 500) | 1 if rng.random() < 0.3 else 2 * rng.randint(2, 250),),
)
def prop_VII_31(n: int) -> Out:
    hypothesis("the number is composite", n > 3 and not is_prime(n))
    factors = prime_factors(n)
    claim("a prime factor was found", "VII.31", bool(factors) and is_prime(factors[0]))
    claim("and it measures the number", "Def.VII.3", n % factors[0] == 0)
    return Out(prime=factors[0])