{"id":"zenodo:24663045","source":"zenodo","external_id":"10.5281/zenodo.24663045","doi":"10.5281/zenodo.24663045","title":"Machine-Checked Formalization and Bidirectional Specification Equivalence of Residue-Conditioned Natural Density in Lean 4","abstract":"Formalizing elementary number-theoretic density results in an interactive theorem prover exposes a recurring verification-engineering challenge: two distinct formalizations of the same informal specification — one phrased functionally via arithmetic radicals and integer congruences, the other phrased set-theoretically via finite prime-support operations — can diverge subtly on edge cases unless their equivalence is itself machine-checked. We present a modular, zero-sorry, zero-custom-axiom Lean 4 (v4.21.0 / Mathlib4) formalization of residue-conditioned coprimality natural density (formulated as the General Divisor Theorem in an unreviewed specification by Hawkley), comprising 7 production modules (2,311 lines of code, 60 top-level kernel-checked theorems). For any positive integers N, m and residue a, with d = rad(gcd(m, N)), R = rad(N)/d, and T_min = mR, the development machine-checks: (i) the exact admissible/inadmissible dichotomy (emptiness vs. period T_min); (ii) exact per-period count phi(R) via an explicit affine permutation on ZMod R; (iii) closed-form arbitrary-bound counting C(q T_min + s) = q phi(R) + C(s); (iv) the explicit finite-sample convergence rate |C(X)/X - phi(R)/T_min| <= T_min/X for all X > 0 and asymptotic natural density via the real squeeze theorem; (v) the integer correction identity underlying d/phi(d); and (vi) a bidirectional specification-equivalence bridge proving parameter, predicate, periodicity, and benchmark agreement between the functional arithmetic and prime-support Finset specifications. All 18 headline theorems are audited in CI via #print axioms, depending strictly on [propext, Classical.choice, Quot.sound].","primary_category":"cs.AI","domain":"cs","license_url":"https://creativecommons.org/licenses/by/4.0/","license_short":"CC BY 4.0","can_host_fulltext":true,"pdf_url":"/pdf/zenodo:24663045.pdf","canonical_url":"https://zenodo.org/records/24663045","source_repo_url":"https://github.com/pCwOrM/general-divisor-theorem","proof_system":"Lean 4","tcb_grade":"TCB-2","track":"verified","tcb_notes":"Seeded with linked Lean 4 artifact (https://github.com/pCwOrM/general-divisor-theorem); eligible for sandboxed TCB-0/TCB-1 promotion.","merkle_root":"c155ade8154b39cd6d9a99e837d6057ea4451a3b5d199360e6b4e819053d1a4e","published_at":"2026-11-29","ingested_at":"2026-11-30T13:55:12+00:00","version":1,"doi_url":"https://doi.org/10.5281/zenodo.24663045","authors":["Dagli, Volkan","Dagli, Zerrin","Dagli, Daghan"],"categories":["cs.AI"],"ai_provenance":{"disclosed":false,"models":["Indexed from Zenodo Open Preprints"],"human_role":"Dagli, Volkan, Dagli, Zerrin, Dagli, Daghan","verification_notes":"Passed certXiv prompt-artifact hygiene scan on ingestion."},"audit_report":{"passed":true,"source":"zenodo-open-preprint","findings":[]},"tcb_meta":{"code":"TCB-2","label":"Reproducible Compute","track":"verified","rank":2,"icon":"●","summary":"Backed by executable verification code, simulation scripts, or hybrid formal+tested artifacts with SHA-256 integrity hash."},"claims":[],"citations":[],"upgrades":[],"verification_jobs":[],"versions":[],"reviews":[],"latest_review":null}