Book VIII · Proposition 2
To find numbers in continued proportion, as many as may be prescribed, and the least that are in a given ratio.Heath, 1908
Needs: VIII.1
Used by: VIII.9
Rests on: Def.VII.20
Depth: 3 steps of argument above the first principles. Parallel postulate: not needed.
Nothing. It draws no intersections and reads nothing off the picture.
@proposition(
"VIII.2",
CONSTRUCTION,
sample=progression,
)
def prop_VIII_2(p: int, q: int, count: int) -> Out:
"""Find the least numbers in continued proportion in a given ratio."""
hypothesis("the ratio is a genuine one", p > 1 and q > 1, guard=True)
# Leastness is what this proposition sets out to produce, and the
# construction delivers it only for a ratio already in least terms. Euclid's
# own enunciation says "the least that are in a given ratio", so this is his
# condition and not our bookkeeping.
hypothesis("the given ratio is in least terms", coprime(p, q))
hypothesis("a genuine progression is asked for", count >= 3, guard=True)
terms = continued_proportion(1, (p, q), count)
because(prop_VIII_1, p, q, count) if coprime(p, q) else None
claim("as many numbers as were asked for were found", "VIII.2", len(terms) == count)
claim("they are in continued proportion in the given ratio", "Def.VII.20",
in_continued_proportion(terms)
and all(terms[i + 1] * q == terms[i] * p for i in range(count - 1)))
claim("and they are the least such, their extremes being prime", "VIII.1",
coprime(terms[0], terms[-1]))
return Out(terms=terms)