Book IX · Proposition 23

IX.23

If as many odd numbers as we please be added together, and their multitude be odd, the whole will also be odd.Heath, 1908

Every step, checked

What it needs, and what needs it

Needs: IX.22

Used by: IX.25 IX.29

Rests on: Def.VII.6

Depth: 2 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(
    "IX.23",
    THEOREM,
    sample=lambda rng: _odd_numbers(rng, even_count=False),
)
def prop_IX_23(given: list) -> Out:
    hypothesis("all the numbers are odd", all(not measures(2, n) for n in given) and given)
    hypothesis("they are odd in multitude", not measures(2, len(given)))
    because(prop_IX_22, given + [given[0]]) if len(given) % 2 else None

    claim("the sum is odd", "IX.22", not measures(2, sum(given)))
    return Out(total=sum(given))