Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

R03 candidate definition: r03 defs 308a4c5b4d v5 FiniteBoundary

Definition
r03_defs_308a4c5b4d_v5_FiniteBoundary

by hao jia · Sep 17, 2026 · Mathlib 0df444a (Lean v4.33.1)

graph-theoryopg-46613p3-factorsource-faithful-candidate

This is a source-faithful definition module supporting a conditional formalization of the cubic P3-partition problem. It contains data structures and predicates used by separately published theorem candidates; it does not assert that the open root problem is solved.

Definition code
import Mathlib.Data.Fin.VecNotation

/- Candidate finite catalogue; no graph-level semantics or admission. -/
namespace R03FiniteBoundaryV5
set_option maxRecDepth 10000
set_option maxHeartbeats 1000000

def leafMasks : Fin 16 → Nat := ![0,1,2,3,4,5,6,8,9,10,12,16,17,18,20,24]
def centerMasks : Fin 6 → Nat := ![0,1,2,4,8,16]
def bit (m i : Nat) : Nat := m / 2^i % 2
def ones (m : Nat) : Nat := bit m 0 + bit m 1 + bit m 2 + bit m 3 + bit m 4
def x (a b : Fin 16) (c : Fin 6) (i : Nat) : Nat :=
  bit (if i % 3 = 0 then leafMasks a else if i % 3 = 1 then centerMasks c else leafMasks b) (i / 3)
def d1 (a b : Fin 16) (c : Fin 6) : Nat := x a b c 0 + x a b c 1 + x a b c 2
def d2 (a b : Fin 16) (c : Fin 6) : Nat := x a b c 3 + x a b c 4 + x a b c 5
def d3 (a b : Fin 16) (c : Fin 6) : Nat := x a b c 6 + x a b c 7 + x a b c 8
def d6 (a b : Fin 16) (c : Fin 6) : Nat := x a b c 0 + x a b c 3 + x a b c 6 + x a b c 9 + x a b c 12
def d7 (a b : Fin 16) (c : Fin 6) : Nat := x a b c 1 + x a b c 4 + x a b c 7 + x a b c 10 + x a b c 13
def d8 (a b : Fin 16) (c : Fin 6) : Nat := x a b c 2 + x a b c 5 + x a b c 8 + x a b c 11 + x a b c 14
def total (a b : Fin 16) (c : Fin 6) : Nat := x a b c 0 + x a b c 1 + x a b c 2 + x a b c 3 + x a b c 4 + x a b c 5 + x a b c 6 + x a b c 7 + x a b c 8 + x a b c 9 + x a b c 10 + x a b c 11 + x a b c 12 + x a b c 13 + x a b c 14
def Valid (a b : Fin 16) (c : Fin 6) : Prop :=
  (x a b c 0 + x a b c 1 + x a b c 2) ≤ 1 ∧
  (x a b c 3 + x a b c 4 + x a b c 5) ≤ 1 ∧
  (x a b c 6 + x a b c 7 + x a b c 8) ≤ 2 ∧
  (x a b c 9 + x a b c 10 + x a b c 11) ≤ 2 ∧
  (x a b c 12 + x a b c 13 + x a b c 14) ≤ 2 ∧
  x a b c 0 + x a b c 7 ≤ 1 ∧
  x a b c 0 + x a b c 8 ≤ 1 ∧
  x a b c 0 + x a b c 13 ≤ 1 ∧
  x a b c 0 + x a b c 14 ≤ 1 ∧
  x a b c 2 + x a b c 6 ≤ 1 ∧
  x a b c 2 + x a b c 7 ≤ 1 ∧
  x a b c 2 + x a b c 12 ≤ 1 ∧
  x a b c 2 + x a b c 13 ≤ 1 ∧
  x a b c 3 + x a b c 7 ≤ 1 ∧
  x a b c 3 + x a b c 8 ≤ 1 ∧
  x a b c 3 + x a b c 10 ≤ 1 ∧
  x a b c 3 + x a b c 11 ≤ 1 ∧
  x a b c 5 + x a b c 6 ≤ 1 ∧
  x a b c 5 + x a b c 7 ≤ 1 ∧
  x a b c 5 + x a b c 9 ≤ 1 ∧
  x a b c 5 + x a b c 10 ≤ 1 ∧
  x a b c 6 + x a b c 11 ≤ 1 ∧
  x a b c 6 + x a b c 14 ≤ 1 ∧
  x a b c 7 + x a b c 9 ≤ 1 ∧
  x a b c 7 + x a b c 11 ≤ 1 ∧
  x a b c 7 + x a b c 12 ≤ 1 ∧
  x a b c 7 + x a b c 14 ≤ 1 ∧
  x a b c 8 + x a b c 9 ≤ 1 ∧
  x a b c 8 + x a b c 12 ≤ 1 ∧
  x a b c 9 + x a b c 13 ≤ 1 ∧
  x a b c 9 + x a b c 14 ≤ 1 ∧
  x a b c 10 + x a b c 12 ≤ 1 ∧
  x a b c 10 + x a b c 14 ≤ 1 ∧
  x a b c 11 + x a b c 12 ≤ 1 ∧
  x a b c 11 + x a b c 13 ≤ 1

end R03FiniteBoundaryV5
Source
VibeMathing candidate definition artifact: Definitions/Def_r03_defs_308a4c5b4d_v5_FiniteBoundary.lean; candidate-only formalization for ProblemContract problem:opg-46613-p3-partition.

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