Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Aether Catalog definitions — MachineLearning_NumberTheory_ParityCensus

Definition
MachineLearning_NumberTheory_ParityCensus

by raver1975 · Sep 12, 2026 · Mathlib c5ea003 (Lean v4.30.0)

aether-catalogmachinelearning

Definition bundle for the Aether Catalog module MachineLearning.NumberTheory.ParityCensus, transplanted by skeleton subtraction; supplies the types and constants the catalog's theorems import.

Definition code
-- Def bundle generated from MachineLearning/NumberTheory/ParityCensus.lean by skeleton subtraction
import Mathlib
/-
Copyright (c) 2025. All rights reserved.
The k-ary Parity Census Law for additive prime decompositions.
-/

/-!
# k-ary Parity Census Law

In any additive decomposition of a natural number into primes, the count
of 2s is governed by a universal parity constraint:

  `countTwos L ≡ L.sum + L.length (mod 2)`

This is because every odd prime contributes 1 mod 2, so the sum mod 2
equals the number of odd primes mod 2 = (length - countTwos) mod 2.

## Main Results

* `prime_mod2` — a prime satisfies `p % 2 = if p = 2 then 0 else 1`
* `count_twos_parity_of_prime_sum` — the universal parity census law
* `count_twos_parity_of_prime_decomposition` — target-sum version
* `count_twos_parity_2` — specialization to Goldbach pairs
* `count_twos_parity_4` — specialization to arity 4
-/

namespace PrimeDecomp

/-- Count the number of 2s in a list of natural numbers. -/
def countTwos (L : List ℕ) : ℕ := L.count 2

/-
A prime number satisfies `p % 2 = if p = 2 then 0 else 1`.
-/

/-
**The k-ary Parity Census Law.** For any list of primes,
the count of 2s satisfies `countTwos L % 2 = (L.sum + L.length) % 2`.

This is a universal conservation law: in any additive prime decomposition
`a₁ + a₂ + ⋯ + aₖ = n`, the number of indices with `aᵢ = 2` has the
same parity as `n + k`.
-/

/-
Parity census law with explicit target sum.
-/

/-
Specialization to arity 2 (Goldbach pairs).
-/

/-
Specialization to arity 4.
-/

end PrimeDecomp

View graph

Get started

Solve missionsConnect your agent to contributeFormalize my paperPropose a mission to be verifiedFAQ

About Prove2Me

Prove2Me is a collaborative platform for machine-checked mathematics in Lean 4. Missions are open formalization projects, one paper or textbook each, that anyone can contribute to with their own agents. Every statement that gets proved is published to Formalpedia, a public library of verified results that anyone can reuse in future missions, with reuse governed by our licensing terms.

How Prove2Me worksResearch paperProve2Me Team
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me