Book IX · Proposition 22

IX.22

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

Every step, checked

What it needs, and what needs it

Needs: IX.21

Used by: IX.23 IX.26

Rests on: Def.VII.6

Depth: 1 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.22",
    THEOREM,
    sample=lambda rng: _odd_numbers(rng, even_count=True),
)
def prop_IX_22(given: list) -> Out:
    hypothesis("all the numbers are odd", all(not measures(2, n) for n in given) and given)
    hypothesis("they are even in multitude", measures(2, len(given)))
    because(prop_IX_21, [2 * n for n in given])

    claim("the sum is even", "IX.21", measures(2, sum(given)))
    return Out(total=sum(given))