Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Aether Catalog definitions — MachineLearning_WeakChen

Definition
MachineLearning_WeakChen

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

aether-catalogmachinelearning

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

Definition code
-- Def bundle generated from MachineLearning/WeakChen.lean by skeleton subtraction
import Mathlib
/-
Copyright (c) 2025. All rights reserved.
Weak Chen decomposition: definitions and bounded verification.
-/

/-!
# Weak Chen Decomposition: Bounded Verification

A number is *semiprime* if it equals a product of exactly two primes.
A *weak Chen decomposition* of `n` writes `n = p + s` where `p` is prime
and `s` is either prime or semiprime.

We verify computationally that every even number from 4 to 100
admits a weak Chen decomposition.

## Main Results

* `semiprime_4`, `semiprime_6`, `semiprime_9` — basic examples
* `prime_is_prime_or_semiprime` — trivial inclusion
* `weak_chen_4_to_100` — verified for [4, 100]
-/

namespace PrimeDecomp

/-- A natural number is semiprime if it is a product of exactly two primes. -/
def Semiprime (n : ℕ) : Prop :=
  ∃ a b : ℕ, Nat.Prime a ∧ Nat.Prime b ∧ a * b = n

/-- Weak Chen decomposition: `n = p + s` where `p` is prime and `s` is
either prime or semiprime. -/
def HasWeakChenDecomposition (n : ℕ) : Prop :=
  ∃ p s : ℕ, Nat.Prime p ∧ (Nat.Prime s ∨ Semiprime s) ∧ p + s = n

/-- `Semiprime` is decidable by bounded search. -/
instance semiprimeDecidable (n : ℕ) : Decidable (Semiprime n) :=
  decidable_of_iff
    (∃ a ∈ Finset.range (n + 1), ∃ b ∈ Finset.range (n + 1),
      Nat.Prime a ∧ Nat.Prime b ∧ a * b = n)
    ⟨fun ⟨a, _, b, _, ha, hb, hab⟩ => ⟨a, b, ha, hb, hab⟩,
     fun ⟨a, b, ha, hb, hab⟩ => ⟨a, Finset.mem_range.mpr (by
        have := ha.pos; nlinarith [hb.pos]),
      b, Finset.mem_range.mpr (by
        have := hb.pos; nlinarith [ha.pos]),
      ha, hb, hab⟩⟩

/-- `HasWeakChenDecomposition` is decidable by bounded search. -/
instance hasWeakChenDecidable (n : ℕ) :
    Decidable (HasWeakChenDecomposition n) :=
  decidable_of_iff
    (∃ p ∈ Finset.range (n + 1), ∃ s ∈ Finset.range (n + 1),
      Nat.Prime p ∧ (Nat.Prime s ∨ Semiprime s) ∧ p + s = n)
    ⟨fun ⟨p, _, s, _, hp, hs, hps⟩ => ⟨p, s, hp, hs, hps⟩,
     fun ⟨p, s, hp, hs, hps⟩ => ⟨p, Finset.mem_range.mpr (by omega),
      s, Finset.mem_range.mpr (by omega), hp, hs, hps⟩⟩






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