Nullius Labs
No. 002◐ REPRODUCED2026-11-25

Disproved: Almiron-Moyano question: every numerical semigroup with mu <= 4 has a gap g with Wilf number W(g) >= 0

A public claim that this conjecture is false. We rebuilt the claimed counterexample from scratch and two separately written checkers confirmed it in exact arithmetic. Both sides of this check came from the same AI model, because the second model was unavailable. Machine-checked; not peer reviewed.

Source paper · original claim

Rerun it yourself: download the certificate and a checker, then

python3 checker_b.py certificate.json

Statement, as tested

Download statement.md
# Almiron-Moyano question: every numerical semigroup with mu <= 4 has a gap g with Wilf number W(g) >= 0

Source: https://arxiv.org/abs/2012.01358


Public claim to check: https://github.com/1337isnot1337/solved-conjectures/tree/main/results/almiron-moyano-wilf-module-questions

Source: P. Almiron, J. J. Moyano-Fernandez, preprint on Wilf's conjecture and the Wilf function of numerical semigroups and semimodules, arXiv:2012.01358v3, Section 4.1, Question 4.8 (asked as a question; the affirmative answer is the statement tested). Definitions (from the arXiv source): a numerical semigroup Gamma is a submonoid of (N,+) with finite complement; its gaps are the elements of N\Gamma; the conductor c(Gamma) is the least c with c+N ⊆ Gamma; delta(Gamma) is the number of elements of Gamma smaller than c(Gamma). The Wilf function is W_Gamma(k)=k*delta(Gamma)-c(Gamma), and mu_Gamma=min{k in N: W_Gamma(k)>=0} (mu_Gamma=2 iff Gamma is symmetric). A Gamma-semimodule is a subset Delta of N with Delta+Gamma ⊆ Delta; c(Delta) and delta(Delta) are defined in the same way. For a gap g, Delta_I with I=[0,g] is Delta=Gamma ∪ (g+Gamma), and the Wilf number of the gap is W(g)=2*delta(Delta_I)-c(Delta_I). The paper proves max_g W(g) <= W_Gamma(4), so semigroups with mu_Gamma>4 have W(g)<0 for all gaps. Question 4.8: is there always a gap g with W(g)>=0 for any numerical semigroup with mu_Gamma<=4?

Repository claim: the answer is NO, by an explicit family already at mu=2. For each m>=5 take T_m={0} ∪ [m,2m-2] ∪ [2m,infinity) (symmetric, c=2m, delta=m, so mu=2; smallest instance m=5: T_5={0,5,6,7,8,10,11,...} with gaps 1,2,3,4,9). The repository computes (c(Delta_g),delta(Delta_g))=(m,2) for 1<=g<=m-2, (m-1,1) for g=m-1, and (m,1) for g=2m-1, giving W(g)=4-m, 3-m, 2-m respectively, all negative. Located in results/almiron-moyano-wilf-module-questions/PROOF.md ('A family at threshold two'); Lean scope in LEAN.md. The folder additionally claims answers to the open-ended Question 4.13(1)-(2) on semimodule thresholds (min k with k*delta(Delta)>=c(Delta) for all normalized S-modules equals the multiplicity m) in MODULE-THRESHOLDS.md; that part is a characterization, not a counterexample.
{
  "statement": "Almiron-Moyano Question 4.8 (arXiv:2012.01358v3): every numerical semigroup with mu <= 4 has a gap g with W(g) >= 0",
  "verdict": "false",
  "semigroup_gaps": [1, 2, 3, 4, 9]
}

Certificate format

Download CERTIFICATE.md
# Certificate: a numerical semigroup with mu = 2 and W(g) < 0 for every gap

## What is claimed

The statement "every numerical semigroup Gamma with mu_Gamma <= 4 has a gap g
with W(g) >= 0" (affirmative form of Question 4.8 of Almiron & Moyano-Fernandez,
arXiv:2012.01358v3) is **false**. The certificate is one numerical semigroup.

## File format (`certificate.json`)

A JSON object. Only one field is used by the verifier:

- `semigroup_gaps`: a list of distinct positive integers. The semigroup is
  Gamma = {0,1,2,3,...} minus this list. Nothing else is needed to rebuild it.

`statement` and `verdict` are human-readable labels and are ignored.

The object here: gaps `[1,2,3,4,9]`, i.e.
Gamma = {0,5,6,7,8,10,11,12,...} = <5,6,7,8> (the case m=5 of the family
T_m = {0} u [m,2m-2] u [2m,oo) from the public claim).

## What `verify.py` checks (integers only, standard library only)

1. Gamma contains 0, has finite complement (by construction) and is closed
   under addition (all pairs a,b in Gamma with a+b <= largest gap are tested;
   larger sums cannot be gaps).
2. c(Gamma) = largest gap + 1; delta(Gamma) = #{x in Gamma : x < c}.
   mu_Gamma = min{k : k*delta - c >= 0} is computed and required to be <= 4.
3. For **every** gap g: Delta_g = Gamma u (g+Gamma); c(Delta_g) = (largest
   natural number not in Delta_g) + 1 (0 if none); delta(Delta_g) =
   #{x in Delta_g : x < c(Delta_g)}; W(g) = 2*delta(Delta_g) - c(Delta_g).
   It requires W(g) < 0 for all gaps.

Values for this certificate: c = 10, delta = 5, mu = 2;

| g | c(Delta_g) | delta(Delta_g) | W(g) |
|---|-----------|----------------|------|
| 1 | 5 | 2 | -1 |
| 2 | 5 | 2 | -1 |
| 3 | 5 | 2 | -1 |
| 4 | 4 | 1 | -2 |
| 9 | 5 | 1 | -3 |

## Caveat on sign conventions (honest note)

The check uses the definitions exactly as written in statement.md and in the
paper's text (delta(Delta) = number of elements of Delta below the conductor,
W(g) = 2*delta(Delta_I) - c(Delta_I)); the paper's Theorem max W(g) <= W_Gamma(4)
that motivates the question is proved with this same formula. However, when the
same definitions are applied to the paper's own example table for
Gamma = <6,8,35>, every nonzero entry comes out with the OPPOSITE sign
(e.g. g=2 gives +2 from the definitions, the table prints -2). So the paper's
numerical tables appear to use -W(g) (as in its Proposition quoting "-W(g) = ...").
Under that opposite sign convention (c - 2*delta) this semigroup would have all
W(g) > 0 and would not be a counterexample. The certificate settles the
statement as literally defined; a reader should be aware of this inconsistency
in the source.

Checker A, written alongside the certificate

Download checker_a.py
#!/usr/bin/env python3
"""Usage: python3 verify.py certificate.json

Checks, with integer arithmetic only, that the set Gamma = N \\ semigroup_gaps
is a numerical semigroup with mu_Gamma <= 4 for which EVERY gap g has
W(g) = 2*delta(Delta_g) - c(Delta_g) < 0, where Delta_g = Gamma u (g + Gamma).
Standard library only.
"""
import json
import sys


def fail(msg):
    print("FAILED: " + msg)
    sys.exit(1)


def main():
    if len(sys.argv) != 2:
        fail("usage: python3 verify.py certificate.json")
    with open(sys.argv[1]) as f:
        cert = json.load(f)
    gaps = cert.get("semigroup_gaps")
    if not isinstance(gaps, list) or not gaps:
        fail("semigroup_gaps must be a non-empty list")
    for x in gaps:
        if type(x) is not int or x <= 0:
            fail("gaps must be positive integers (0 must belong to Gamma)")
    if len(set(gaps)) != len(gaps):
        fail("gaps must be distinct")
    if len(gaps) > 5000 or max(gaps) > 100000:
        fail("certificate too large for this verifier")
    G = frozenset(gaps)
    F = max(G)

    # Gamma = N \ G.  Finite complement holds by construction; 0 is in Gamma.
    def in_gamma(n):
        return n >= 0 and n not in G

    # Closure under addition: a+b > F is never a gap, so only a+b <= F matters.
    for a in range(F + 1):
        if in_gamma(a):
            for b in range(a, F + 1 - a):
                if in_gamma(b) and not in_gamma(a + b):
                    fail("not closed under addition: %d + %d" % (a, b))

    # Conductor: least c with c + N inside Gamma  =  (largest gap) + 1.
    c = F + 1
    delta = sum(1 for n in range(c) if in_gamma(n))
    print("Gamma: gaps =", sorted(G), " c =", c, " delta =", delta)

    # mu = min{k in N : k*delta - c >= 0}; search k = 0..4 only (need mu <= 4).
    mu = None
    for k in range(0, 5):
        if k * delta - c >= 0:
            mu = k
            break
    if mu is None:
        fail("mu_Gamma > 4, hypothesis of the question not met")
    print("mu_Gamma =", mu, "(<= 4)")

    # Every gap g: Delta_g = Gamma u (g + Gamma), a Gamma-semimodule in N.
    for g in sorted(G):
        def in_delta(n, g=g):
            return in_gamma(n) or in_gamma(n - g)
        # Every n >= c lies in Gamma, hence in Delta_g: all gaps of Delta_g are < c.
        non = [n for n in range(c) if not in_delta(n)]
        cd = (max(non) + 1) if non else 0          # conductor of Delta_g
        for n in range(cd, c + g + 1):              # redundant sanity check
            if not in_delta(n):
                fail("internal conductor error")
        if cd > 0 and in_delta(cd - 1):
            fail("internal conductor error")
        # semimodule property Delta + Gamma inside Delta (redundant; finite window)
        for x in range(c):
            if in_delta(x):
                for s in range(c - x):
                    if in_gamma(s) and not in_delta(x + s):
                        fail("Delta_g is not a Gamma-semimodule")
        dd = sum(1 for n in range(cd) if in_delta(n))  # delta(Delta_g)
        W = 2 * dd - cd
        print("gap g = %d: c(Delta) = %d, delta(Delta) = %d, W(g) = %d" % (g, cd, dd, W))
        if W >= 0:
            fail("gap %d has W(g) >= 0; not a counterexample" % g)

    print("All %d gaps have W(g) < 0 while mu_Gamma = %d <= 4." % (len(G), mu))
    print("VERIFIED")
    sys.exit(0)


if __name__ == "__main__":
    try:
        main()
    except SystemExit:
        raise
    except Exception as e:  # any unexpected problem is a failure
        print("FAILED: %r" % (e,))
        sys.exit(1)

Checker B, written independently from the certificate alone

Download checker_b.py
#!/usr/bin/env python3
"""Independent checker: counterexample to the affirmative form of Question 4.8
of Almiron & Moyano-Fernandez (arXiv:2012.01358v3).

Statement tested: "every numerical semigroup Gamma with mu_Gamma <= 4 has a
gap g with W(g) >= 0".  A certificate refutes it by exhibiting ONE numerical
semigroup Gamma with mu_Gamma <= 4, at least one gap, and W(g) < 0 for EVERY gap.

Definitions (statement.md, cross-checked with the arXiv HTML of v3):
  c(Gamma)     = F(Gamma)+1, F = largest gap
  delta(Gamma) = #{x in Gamma : x < c(Gamma)}
  W_Gamma(k)   = k*delta(Gamma) - c(Gamma);  mu = min{k in N : W_Gamma(k) >= 0}
  Delta_g      = Gamma u (g+Gamma)  (semimodule minimally generated by [0,g])
  c(Delta)     = (largest element of N \\ Delta) + 1,
  delta(Delta) = #{x in Delta : x < c(Delta)}
  W(g)         = 2*delta(Delta_g) - c(Delta_g)
All arithmetic is on Python ints.  Standard library only.
"""
import json
import sys

MAX_FROB = 20000  # size guard so the quadratic closure test stays fast


def fail(msg):
    print("FAILED: " + msg)
    sys.exit(1)


def is_int(x):
    return isinstance(x, int) and not isinstance(x, bool)


def main():
    if len(sys.argv) != 2:
        fail("usage: python3 checker.py certificate.json")
    try:
        with open(sys.argv[1], "r") as fh:
            cert = json.load(fh)
    except Exception as e:  # malformed file
        fail("cannot read/parse certificate: %r" % (e,))
    if not isinstance(cert, dict) or "semigroup_gaps" not in cert:
        fail("certificate is not a JSON object with field 'semigroup_gaps'")
    gaps = cert["semigroup_gaps"]
    if not isinstance(gaps, list) or not all(is_int(x) for x in gaps):
        fail("'semigroup_gaps' must be a list of integers")
    if len(gaps) == 0:
        fail("no gaps: Gamma = N is a degenerate case, not accepted as a counterexample")
    if any(x <= 0 for x in gaps):
        fail("gaps must be positive (0 must belong to Gamma)")
    if len(set(gaps)) != len(gaps):
        fail("gaps are not distinct")
    G = set(gaps)
    F = max(G)
    if F > MAX_FROB:
        fail("largest gap exceeds the size guard %d" % MAX_FROB)

    # ---- Gamma = N \ G.  Membership test valid for every natural number.
    def in_gamma(x):
        return x >= 0 and x not in G

    c = F + 1
    small = [x for x in range(c) if x not in G]  # elements of Gamma below c
    # (1) submonoid: 0 in Gamma (gaps are positive), finite complement (G finite),
    # closed under addition.  A sum a+b can fail to lie in Gamma only if it is a
    # gap, hence <= F, hence a,b <= F; so testing pairs from `small` is complete.
    assert in_gamma(0)
    for i, a in enumerate(small):
        if a == 0:
            continue
        for b in small[i:]:
            s = a + b
            if s > F:
                break
            if s in G:
                fail("not closed under addition: %d + %d = %d is a gap" % (a, b, s))

    # (2) conductor, delta, mu
    # c is the least c with c+N in Gamma: F = c-1 is a gap, everything >= c is in Gamma.
    delta = len(small)
    if delta != c - len(G):
        fail("internal inconsistency in delta(Gamma)")
    if delta < 1:
        fail("internal inconsistency: delta < 1")
    mu = 0
    while mu * delta - c < 0:
        mu += 1
    print("Gamma: gaps=%s  c=%d  delta=%d  mu=%d" % (sorted(G), c, delta, mu))
    if mu > 4:
        fail("mu_Gamma = %d > 4, hypothesis of the statement not met" % mu)

    # (3) every gap
    W4 = 4 * delta - c
    for g in sorted(G):
        # Delta_g = Gamma u (g + Gamma).  Every x >= c lies in Gamma, so
        # N \ Delta_g is contained in [0, c-1]; scan that range exhaustively.
        def in_delta(x):
            return in_gamma(x) or in_gamma(x - g)

        # Delta_g must be a Gamma-semimodule (automatic for a monoid Gamma, but
        # re-verified): x in Delta_g, s in Gamma => x+s in Delta_g.  Only sums
        # < c can fail.
        dl_small = [x for x in range(c) if in_delta(x)]
        dl_gaps = [x for x in range(c) if not in_delta(x)]
        for x in dl_small:
            for s in small:
                if x + s >= c:
                    break
                if not in_delta(x + s):
                    fail("Delta_%d is not a Gamma-semimodule" % g)
        # independent brute-force rebuild of Delta_g on [0, c+g] as a set union
        lim = c + g
        gam = set(x for x in range(lim + 1) if x not in G)
        union = gam | set(x + g for x in gam if x + g <= lim)
        if set(x for x in range(lim + 1) if x not in union) != set(dl_gaps):
            fail("two constructions of Delta_%d disagree" % g)

        cD = (max(dl_gaps) + 1) if dl_gaps else 0
        dD = sum(1 for x in range(cD) if in_delta(x))
        Wg = 2 * dD - cD
        print("g=%d: c(Delta)=%d delta(Delta)=%d W(g)=%d" % (g, cD, dD, Wg))
        # sanity: paper's Theorem 4.2 (W(g) <= W_Gamma(4)) pins the sign convention
        if Wg > W4:
            fail("W(%d)=%d exceeds W_Gamma(4)=%d, contradicting Theorem 4.2; "
                 "definitions misapplied" % (g, Wg, W4))
        if Wg >= 0:
            fail("gap g=%d has W(g)=%d >= 0; not a counterexample" % (g, Wg))

    print("Numerical semigroup with mu=%d <= 4 and W(g) < 0 for all %d gaps: "
          "the statement is refuted." % (mu, len(G)))
    print("VERIFIED")
    sys.exit(0)


if __name__ == "__main__":
    main()