FAILURE MAP
← Case archive

FA-15496 / Numerics / Open access

Hensel simple root lift: formal derivative evaluation · case 01

The exact hensel simple root lift result violates the stated contract at formal derivative evaluation.

Verified by executionVariant 1 · 8 checks per implementationDownload source bundle ↓JSON ↗

ROOT CAUSE

The formal derivative evaluation step uses sum(coeff[i]*r**(i-1) for i in range(1,len(coeff))) instead of sum(i*coeff[i]*r**(i-1) for i in range(1,len(coeff))).

THE FAILURE

The formal derivative evaluation step uses sum(coeff[i]*r**(i-1) for i in range(1,len(coeff))) instead of sum(i*coeff[i]*r**(i-1) for i in range(1,len(coeff))).

Unsuccessful approach: The partial repair sum(i*coeff[i]*r**i for i in range(1,len(coeff))) still violates the formal derivative evaluation invariant.

Case contract

Input [coefficients,p,r,k], p prime, r root mod p with nonzero derivative, k>=1; return unique root mod p^k congruent r mod p.

Why this case matters

Exact discrete arithmetic with observable algorithmic state; no floating point approximation is used.

1 / The failure

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json
import math
import itertools
from fractions import Fraction
N = 1
observations = []
def solve(x):
    coeff,p,r,k=x
    mod=p;r%=p
    for _ in range(1,k):
     value=sum(c*r**i for i,c in enumerate(coeff))
     derivative=sum(coeff[i]*r**(i-1) for i in range(1,len(coeff)))
     if derivative%p==0:return None
     correction=(-(value//mod)*pow(derivative,-1,p))%p
     r=r+mod*correction
     mod=mod*p
     r%=mod
    return [r,mod]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[([[1, 1, 1], 7, 2, 2], [30, 49]), ([[1, 1, 1], 7, 2, 1], [2, 7]), ([[2, 3, 1], 13, 12, 5], [371292, 371293]), ([[1, 1, 1], 7, 2, 3], [324, 343]), ([[1, 1, 1], 7, 2, 4], [1353, 2401]), ([[1, 1, 1], 7, 2, 5], [1353, 16807]), ([[1, 1, 1], 7, 4, 1], [4, 7]), ([[1, 1, 1], 7, 4, 2], [18, 49])], [([[1, 1, 1], 7, 2, 3], [324, 343]), ([[1, 1, 1], 7, 2, 5], [1353, 16807]), ([[1, 1, 1], 7, 2, 1], [2, 7]), ([[2, 3, 1], 13, 12, 5], [371292, 371293]), ([[1, 1, 1], 13, 9, 3], [1036, 2197]), ([[1, 1, 1], 13, 9, 4], [7627, 28561]), ([[1, 1, 1], 13, 9, 5], [150432, 371293]), ([[-2, 0, 1], 7, 3, 1], [3, 7])], [([[1, 1, 1], 7, 2, 4], [1353, 2401]), ([[1, 1, 1], 7, 4, 4], [1047, 2401]), ([[1, 1, 1], 7, 2, 1], [2, 7]), ([[2, 3, 1], 13, 12, 5], [371292, 371293]), ([[-1, 1, 1], 11, 3, 5], [77234, 161051]), ([[-1, 1, 1], 11, 7, 1], [7, 11]), ([[-1, 1, 1], 11, 7, 2], [84, 121]), ([[-1, 1, 1], 11, 7, 3], [1294, 1331])], [([[1, 1, 1], 7, 2, 5], [1353, 16807]), ([[1, 1, 1], 13, 3, 3], [1160, 2197]), ([[1, 1, 1], 7, 2, 1], [2, 7]), ([[2, 3, 1], 13, 12, 5], [371292, 371293]), ([[-3, 1, 2], 7, 1, 2], [1, 49]), ([[-3, 1, 2], 7, 1, 3], [1, 343]), ([[-3, 1, 2], 7, 1, 4], [1, 2401]), ([[-3, 1, 2], 7, 1, 5], [1, 16807])], [([[1, 1, 1], 7, 4, 2], [18, 49]), ([[1, 1, 1], 13, 9, 2], [22, 169]), ([[1, 1, 1], 7, 2, 1], [2, 7]), ([[2, 3, 1], 13, 12, 5], [371292, 371293]), ([[-3, 1, 2], 11, 4, 4], [7319, 14641]), ([[-3, 1, 2], 11, 4, 5], [80524, 161051]), ([[-3, 1, 2], 13, 1, 1], [1, 13]), ([[-3, 1, 2], 13, 1, 2], [1, 169])]]
for i, (args, expected) in enumerate(fixtures[N-1]):
    check("explicit oracle %d" % i, solve(args), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
Boundary fixtureActualExpectedOutcome
explicit oracle 0[16, 49][30, 49]Failed
explicit oracle 1[2, 7][2, 7]Passed
explicit oracle 2[359553, 371293][371292, 371293]Failed
explicit oracle 3[163, 343][324, 343]Failed
explicit oracle 4[163, 2401][1353, 2401]Failed
explicit oracle 5[2564, 16807][1353, 16807]Failed
explicit oracle 6[4, 7][4, 7]Passed
explicit oracle 7[39, 49][18, 49]Failed

SHA-256 / 26c5954da7fe33596e1909a24f8c7969b03f310a69eea34a3d2313ba3a4bbf59

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json
import math
import itertools
from fractions import Fraction
N = 1
observations = []
def solve(x):
    coeff,p,r,k=x
    mod=p;r%=p
    for _ in range(1,k):
     value=sum(c*r**i for i,c in enumerate(coeff))
     derivative=sum(i*coeff[i]*r**i for i in range(1,len(coeff)))
     if derivative%p==0:return None
     correction=(-(value//mod)*pow(derivative,-1,p))%p
     r=r+mod*correction
     mod=mod*p
     r%=mod
    return [r,mod]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[([[1, 1, 1], 7, 2, 2], [30, 49]), ([[1, 1, 1], 7, 2, 1], [2, 7]), ([[2, 3, 1], 13, 12, 5], [371292, 371293]), ([[1, 1, 1], 7, 2, 3], [324, 343]), ([[1, 1, 1], 7, 2, 4], [1353, 2401]), ([[1, 1, 1], 7, 2, 5], [1353, 16807]), ([[1, 1, 1], 7, 4, 1], [4, 7]), ([[1, 1, 1], 7, 4, 2], [18, 49])], [([[1, 1, 1], 7, 2, 3], [324, 343]), ([[1, 1, 1], 7, 2, 5], [1353, 16807]), ([[1, 1, 1], 7, 2, 1], [2, 7]), ([[2, 3, 1], 13, 12, 5], [371292, 371293]), ([[1, 1, 1], 13, 9, 3], [1036, 2197]), ([[1, 1, 1], 13, 9, 4], [7627, 28561]), ([[1, 1, 1], 13, 9, 5], [150432, 371293]), ([[-2, 0, 1], 7, 3, 1], [3, 7])], [([[1, 1, 1], 7, 2, 4], [1353, 2401]), ([[1, 1, 1], 7, 4, 4], [1047, 2401]), ([[1, 1, 1], 7, 2, 1], [2, 7]), ([[2, 3, 1], 13, 12, 5], [371292, 371293]), ([[-1, 1, 1], 11, 3, 5], [77234, 161051]), ([[-1, 1, 1], 11, 7, 1], [7, 11]), ([[-1, 1, 1], 11, 7, 2], [84, 121]), ([[-1, 1, 1], 11, 7, 3], [1294, 1331])], [([[1, 1, 1], 7, 2, 5], [1353, 16807]), ([[1, 1, 1], 13, 3, 3], [1160, 2197]), ([[1, 1, 1], 7, 2, 1], [2, 7]), ([[2, 3, 1], 13, 12, 5], [371292, 371293]), ([[-3, 1, 2], 7, 1, 2], [1, 49]), ([[-3, 1, 2], 7, 1, 3], [1, 343]), ([[-3, 1, 2], 7, 1, 4], [1, 2401]), ([[-3, 1, 2], 7, 1, 5], [1, 16807])], [([[1, 1, 1], 7, 4, 2], [18, 49]), ([[1, 1, 1], 13, 9, 2], [22, 169]), ([[1, 1, 1], 7, 2, 1], [2, 7]), ([[2, 3, 1], 13, 12, 5], [371292, 371293]), ([[-3, 1, 2], 11, 4, 4], [7319, 14641]), ([[-3, 1, 2], 11, 4, 5], [80524, 161051]), ([[-3, 1, 2], 13, 1, 1], [1, 13]), ([[-3, 1, 2], 13, 1, 2], [1, 169])]]
for i, (args, expected) in enumerate(fixtures[N-1]):
    check("explicit oracle %d" % i, solve(args), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
Boundary fixtureActualExpectedOutcome
explicit oracle 0[16, 49][30, 49]Failed
explicit oracle 1[2, 7][2, 7]Passed
explicit oracle 2[92975, 371293][371292, 371293]Failed
explicit oracle 3[163, 343][324, 343]Failed
explicit oracle 4[163, 2401][1353, 2401]Failed
explicit oracle 5[2564, 16807][1353, 16807]Failed
explicit oracle 6[4, 7][4, 7]Passed
explicit oracle 7[32, 49][18, 49]Failed

SHA-256 / 6f182f3c36d23b3727514dd8936a5518cdca6473c1a64b19a656c944beb97b30

HELD IN THE MEMBER ARCHIVE

The verified repair and its recorded checks are member-only.

This mechanism has 8 recorded checks per implementation. The open-access tier publishes the failure and the unsuccessful fix; the repaired source that passes every check, and the observations that prove it, are available to members.

Every case sharing this mechanism uses the same contract and the same repair, so this one record is held back for all of them.

Member access is invitation-based. Sign in with your invited account to inspect the repair.

Sign in to the archive ↗

Verification & scope

A deterministic bounded teaching model. Inputs are restricted to the explicit contract; this is not a production algebra library. This reproducer isolates one failure mechanism. Results cover the supplied fixtures. Variants within a family share a test contract and should remain grouped when constructing evaluation splits. Related mechanisms with a shared evaluation_group must also remain together; these controlled models are not independent production incidents.

Observations recorded using Python 3.12.14 at 2026-09-29T14:39:27.408805+00:00.

Case digest / fb4b8de2de667ab06ba8c2f29b0933a306d8f5576c4f51186d8629f4b08ea98c