Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Mapping selections to unit-residue coordinates

Definition
Couret_ModularDivisorBridge_2d9305253316

by alexcour · Nov 8, 2026 · Mathlib c5ea003 (Lean v4.30.0)

couret-programmecouret-unification-20261108

Defines mapping of words and their selections, and pullback of mapped selections. Encodes a natural number by its residue modulo 30 into C2×C4C_2\times C_4C2​×C4​, using the eight unit residues and a default identity code for other residues. Defines the predicate that all factors in a natural word are coprime to 30. Subsequent correctness claims require the appropriate coprimality hypotheses.

Definition code
import Std
import Definitions.Def_Couret_DivisorCompleteness_e4011d047800

/-!
COU-87 S2M, 2026-10-30: the exact bridge from natural divisors to the
eight-letter modulo-30 automaton. Prime occurrences need not be distinct.
No finite 147-state / 101-class table is imported here.
-/

universe v
namespace Couret

def Word.map {α : Type v} {β : Type v} (f : α → β) : Word α → Word β
  | .empty => .empty
  | .snoc w g => .snoc (w.map f) (f g)

namespace Choice

def map {α : Type v} {β : Type v} (f : α → β) :
    {w : Word α} → Choice w → Choice (w.map f)
  | _, .empty => .empty
  | _, .skip s g => .skip (map f s) (f g)
  | _, .take s g => .take (map f s) (f g)

def pullback {α : Type v} {β : Type v} (f : α → β) :
    (w : Word α) → Choice (w.map f) → Choice w
  | .empty, .empty => .empty
  | .snoc w g, .skip s _ => .skip (pullback f w s) g
  | .snoc w g, .take s _ => .take (pullback f w s) g







end Choice

def rawCode30 (r : Nat) : Code30 :=
  match r with
  | 1 => (0, 0)
  | 7 => (0, 1)
  | 19 => (0, 2)
  | 13 => (0, 3)
  | 11 => (1, 0)
  | 17 => (1, 1)
  | 29 => (1, 2)
  | 23 => (1, 3)
  | _ => (0, 0)

def encode30 (n : Nat) : Code30 := rawCode30 (n % 30)







def Word.coprime30Factors : Word Nat → Prop
  | .empty => True
  | .snoc w p => w.coprime30Factors ∧ Nat.gcd p 30 = 1





























end Couret

Source
Alexandre Couret, Certified minimal memory for a divisor-residue presence observable modulo 30, https://zenodo.org/records/23989640; archive Couret_BC_MOD30_Companion_20261105.zip, SHA-256 9bb2678164c63a9e47c192093f5ce9deb1b7b74a1f1c8fecc77f305a408266a2; file source/S4/ModularDivisorBridge.lean; source file SHA-256 f72e04425efd9d90f42cc1765e52bcd661653cc739601fb88631de6f94f69c41

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