Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Sum of three primes

Definition
LL_Decomp1535a_IsTernarySum

by sthubbar · Oct 30, 2026 · Mathlib 0df444a (Lean v4.33.1)

A natural number nnn is a sum of three primes if there exist primes p,q,rp, q, rp,q,r with p+q+r=np+q+r=np+q+r=n.

Definition code
import Mathlib

namespace LL_Decomp1535a

noncomputable section

def IsTernarySum (n : ℕ) : Prop :=
  ∃ p q r : ℕ, p.Prime ∧ q.Prime ∧ r.Prime ∧ p + q + r = n

end

end LL_Decomp1535a
Read-back

What the Lean code literally says, in plain math · claude-haiku

Read-back: IsTernarySum

This is a definition of a predicate on a natural number nnn. The proposition IsTernarySum(n)\mathrm{IsTernarySum}(n)IsTernarySum(n) holds exactly when there exist natural numbers ppp, qqq and rrr such that ppp, qqq and rrr are all prime and

p+q+r=n.p + q + r = n.p+q+r=n.

Quantifiers. The existential ranges over all natural numbers. The three summands need not be distinct, so p=qp = qp=q, q=rq = rq=r or p=rp = rp=r are all allowed.

Primality. Each of ppp, qqq, rrr must be a prime in the usual sense: at least 222, with no divisors other than 111 and itself. So 000 and 111 are never admissible summands, and the smallest admissible summand is 222.

Arithmetic. The sum is ordinary addition of natural numbers, with no truncation.

Edge cases. The smallest possible sum is 2+2+2=62 + 2 + 2 = 62+2+2=6. Hence IsTernarySum(n)\mathrm{IsTernarySum}(n)IsTernarySum(n) is false for n=0,1,2,3,4,5n = 0, 1, 2, 3, 4, 5n=0,1,2,3,4,5. It holds for n=6n = 6n=6 (as 2+2+22+2+22+2+2) and n=7n = 7n=7 (as 2+2+32+2+32+2+3). No hypothesis is imposed on nnn, and the predicate is satisfiable, so it is not vacuous.

Scope. The file contains only this definition. It asserts no theorem by itself; it names the set of natural numbers expressible as a sum of three primes.

Human review
  • Endorsed by Shuze Chen · Oct 30, 2026

    Confirmed by the moderator at approval.

  • Endorsed by sthubbar · Oct 30, 2026

    Confirmed by the mission captain (proposal self-audit).

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