code wiki / (root) / nx_arith.nx

nx_arith.nx

buildroot/runtime/nx_arith.nx

5984 B149 linesdepth 6pulls 6 transitivereach 14 importersview sourcekind library
docsdependenciesstructsconstsfunctions

about

nx_arith.nx -- arithmetic Term substrate. Closes the named blocker for proof-by-induction / combinatorial / arithmetic Wiedijk theorems. Per user 2026-05-15: "no losses". Provides: - nat constructors: zero, succ(n), plus(a,b), mult(a,b) - nat literal builder for any concrete N - Peano axioms emitted as v2 kernel axioms with REAL Term shapes - finite induction engine: given P(0) + step axiom, auto-derive P(n) by emitting N modus-ponens applications through the v2 kernel Sym IDs reserved 410001..410010 (arith family; distinct from kernel 400xxx, user 1xxx, FMB 5xxxxx, AVATAR 6xxxxx, etc.)

dependencies 1 imports · 3 importers

nx_kernel_v2.nx nx_arith.nx nx_autoformalize_lib.nx nx_world_class_test.nx nx_world_demo_test.nx

imports: nx_kernel_v2.nx

imported by: nx_autoformalize_lib.nxnx_world_class_test.nxnx_world_demo_test.nx

structs

none

consts

24const NX_ARITH_SYM_ZERO: nx_int = 410001
25const NX_ARITH_SYM_SUCC: nx_int = 410002
26const NX_ARITH_SYM_PLUS: nx_int = 410003
27const NX_ARITH_SYM_MULT: nx_int = 410004
28const NX_ARITH_SYM_LE: nx_int = 410005
29const NX_ARITH_SYM_LT: nx_int = 410006
33const NX_ARITH_AX_PA1_ZERO_NOT_SUCC: nx_int = 411001
34const NX_ARITH_AX_PA2_SUCC_INJECT: nx_int = 411002
35const NX_ARITH_AX_PA3_PLUS_ZERO: nx_int = 411003
36const NX_ARITH_AX_PA4_PLUS_SUCC: nx_int = 411004
37const NX_ARITH_AX_PA5_INDUCTION: nx_int = 411005

functions

40func nx_arith_zero() -> *Term
44func nx_arith_succ(n: *Term) -> *Term
50func nx_arith_plus(a: *Term, b: *Term) -> *Term
59func nx_arith_mult(a: *Term, b: *Term) -> *Term
called by 2: af_derive_multaf_decide calls 1: nx_term_app
69func nx_arith_nat(n: nx_int) -> *Term
103func nx_arith_finite_induction(
135func nx_arith_axiom_plus_zero(ch: *K2Chain, n: *Term) -> nx_int
140func nx_arith_axiom_plus_succ(ch: *K2Chain, n: *Term, m: *Term) -> nx_int
147func nx_arith_axiom_zero_not_succ(ch: *K2Chain, n: *Term) -> nx_int