Identifier
F:nat-sumrangeif-compl
Proof route
kernel-lean
External status
proved
Axiom footprint
Empty

Recorded description

`sumRangeIf p f n + sumRangeIf (setCompl p) f n = sumRange f n` -- a range sum splits into the part its predicate selects and the part it does not. WHY THERE IS NO HYPOTHESIS: this kernel has no `Bool.not` (measured -- `shape_search --name-like bnot` returns ABSENT), and `Nat.setCompl p := fun k => if p k then false else true` (`finite_set.rs`) IS that missing function, already declared and already carrying its own involutivity and De Morgan laws. So the split needs no complementarity side condition at all, unlike `Nat.countRectangle_partition`, which takes one. HOW IT IS PROVED: the additive twin of `Nat.countRange_compl`, and its proof is that proof with `1`/`0` selection replaced by `f j`/`0` -- induction on `n`, one four-term regroup, and one pointwise `Bool.rec` whose two branches are NOT symmetric (`v + 0` reduces by `Nat.add`'s own right-argument rule, `0 + v` does not and needs `Nat.zero_add`). WHY IT DID NOT EXIST: two prior lanes (ADR-1540, ADR-1544) both stopped at the same wall and both MEASURED it rather than guessing -- `examples/shape_search --name-like sumRangeIf` returns ABSENT in every prelude, against a `prodRangeIf` positive control returning 12 declarations. This lane re-ran that measurement on a freshly built binary (declarations=2092, so not a stale artifact reporting a false absence) and got the same two verdicts. `Kernel::axiom_footprint` is EMPTY. Admitted on the first attempt.

Formal statement
theorem Nat.sumRangeIf_compl : ((x0 : ((x0 : AxNat) -> Bool)) -> ((x1 : ((x1 : AxNat) -> AxNat)) -> ((x2 : AxNat) -> Eq.{1} AxNat (AxNat.add (AxNat.sumRange (fun (x3 : AxNat) => Bool.rec.{1} (fun (x4 : Bool) => AxNat) AxNat.zero (x1 x3) (x0 x3)) x2) (AxNat.sumRange (fun (x3 : AxNat) => Bool.rec.{1} (fun (x4 : Bool) => AxNat) AxNat.zero (x1 x3) (AxNat.setCompl x0 x3)) x2)) (AxNat.sumRange x1 x2))))

Dependencies

The graph shows direct ledger edges. Follow a node to open its artifact page.

Direct dependencies appear to the left. The current fact is in the center. Facts that depend directly on it appear to the right. Addition on the naturals is ass [generated] kernel theorem Nat. Nat zero_add Mathlib v4.30 source propositio Current fact
4 direct dependencies 0 direct dependents

Evidence

kernel-Nat.sumRangeIf_compl

Kind
kernel-term
Status
checked

Supports: Nat.sumRangeIf_compl is admitted by the trusted kernel gate with the type recorded in formal.statement.

Checker command
cargo run -q --release -p axeyum-lean-kernel --example theorem_dependency_inventory -- Nat.sumRangeIf_compl 2>/dev/null | grep -cE '^Nat\.sumRangeIf_compl[[:space:]]'
Evidence notes

Two independent failure modes, so the exit status depends on the finding rather than on the run completing: theorem_dependency_inventory exits non-zero when a NAMED filter matches nothing, and grep -c exits 1 printing 0 when the anchored line is absent. RUN WITH A NEGATIVE CONTROL and it was: the real name prints 1 with both pipeline stages at 0, a one-character typo prints 0 with both stages at 1. Anchored with [[:space:]], never \t -- in a scripted (GNU) grep \t is a literal t. grep -c rather than grep -q, which would SIGPIPE the producer under pipefail. --release is MANDATORY. Pass ONE name per invocation: this tool silently keeps only the FIRST name argument.

footprint-Nat.sumRangeIf_compl

Kind
exhaustive-enumeration
Status
checked

Supports: axiom_footprint: [] -- the natural-number prelude's trusted surface is empty, which bounds Nat.sumRangeIf_compl.

Checker command
cargo run -q --release -p axeyum-lean-kernel --example nat_axiom_inventory -- --require-axiom-free nat
Evidence notes

--require-axiom-free exits non-zero when the named prelude's trusted surface (Axiom + Opaque + Quotient) is not empty, and errors rather than silently passing for a prelude the run never built. A declaration cannot depend on a trusted declaration the environment does not contain, so an empty nat surface bounds every declaration in it. This is a whole-prelude bound, not a per-declaration measurement; the per-declaration figure is measured 0 by the axiom-footprint assertion in subset_sum_tests.rs.

numeric-Nat.sumRangeIf_compl

Kind
exhaustive-enumeration
Status
checked

Supports: ADR-1552's check script sweeps this statement's arithmetic over 8450 (modulus, multiplier, bound) instances for the hypothesis-free rows, 519 coprime instances for the counting identity, and 399 coprime odd pairs plus all 240 ordered pairs of distinct odd primes below 60 for Eisenstein's lemma; the control table refutes eight wrong readings at named witnesses.

Checker command
python3 docs/research/09-decisions/adr-1552-eisenstein-checks.py
Evidence notes

Exit status depends on the finding: a claim that fails, or a control that behaves other than as recorded, exits 1. Verified by mutating the script itself in a scratch copy with one uniquely-named file per mutant (so the stale-__pycache__ trap cannot report the previous mutant's result): 16 of 16 mutations exit 1. Two recorded SURVIVORS, M9 and M10, are the argument order of the congruence and of `Even (F + N)` -- invisible to every numeric check and guarded only by the character-for-character type pins in subset_sum_tests.rs.

Provenance

{
  "date": "2026-09-02",
  "curation": "curated",
  "established_by": "axeyum-lean-kernel build_nat_prelude (crates/axeyum-lean-kernel/src/nat_prelude/subset_sum.rs)",
  "source": "formal.statement is taken verbatim from the kernel's own rendering (Kernel::render_lean of the admitted declaration type; the same string is pinned character for character in subset_sum_tests.rs). depends_on is the direct-theorem column of theorem_dependency_inventory intersected with this ledger's registered facts, so it is an INTERSECTION and not the full dependency set -- direct dependencies with no fact row are omitted. Nothing about the statement was hand transcribed; title, statement and the evidence notes were authored (lane eisenstein-3)."
}