Identifier
F:nat-testbit-xor
Proof route
kernel-lean
External status
Not recorded
Axiom footprint
Empty

Recorded description

For every natural m, n, i: testBit(xor(m, n), i) equals the (0/1-valued) XOR combine of testBit(m, i) and testBit(n, i).

Formal statement
theorem Nat.testBit_xor : ((x0 : AxNat) -> ((x1 : AxNat) -> ((x2 : AxNat) -> Eq.{1} AxNat (AxNat.testBit (AxNat.xor x0 x1) x2) (Bool.rec.{1} (fun (x3 : Bool) => AxNat) AxNat.zero (AxNat.succ AxNat.zero) ((fun (x3 : Bool) => fun (x4 : Bool) => Bool.rec.{1} (fun (x5 : Bool) => Bool) x4 (Bool.rec.{1} (fun (x5 : Bool) => Bool) Bool.true Bool.false x4) x3) (AxNat.beq (AxNat.testBit x0 x2) (AxNat.succ AxNat.zero)) (AxNat.beq (AxNat.testBit x1 x2) (AxNat.succ AxNat.zero)))))))

Dependencies

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

Evidence

kernel-Nat.testBit_xor

Kind
kernel-term
Status
checked

Supports: Nat.testBit_xor 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 nat_theorem_inventory -- testBit_xor 2>/dev/null | grep -Ec '^Nat\.testBit_xor[[:space:]]'
Evidence notes

`build_nat_prelude` admits this theorem only through the trusted `Kernel::add_declaration` gate, which re-checks the proof term against the stated type. `nat_theorem_inventory` exits non-zero for a name that does not exist, and `grep -Ec` consumes the pipe so the tested count (expected >= 1) decides the exit status, never `grep -q` under pipefail. Anchored with `[[:space:]]`, never a literal tab, per this ledger's own grep-dialect gotcha. `--release` is mandatory: this tool builds `creal`/`complex`/`cpoint`, which overflow the default debug thread stack.

compute-Nat.testBit_xor

Kind
kernel-term
Status
checked

Supports: At the discriminating instance (m, n) = (5, 3) (binary 101/011, xor 5 3 = 6 = 110), all three meaningfully differing bits (0, 1, 2) check against independently hand-computed values (0, 1, 1), each with a negative control asserting the OTHER bit value does not also def-eq; and the theorem re-derives against a genuinely free (m, n, i) triple, not merely a concrete instance.

Checker command
cargo test -p axeyum-lean-kernel --lib nat_prelude::nat_prelude_tests::test_bit_xor_applies_at_a_concrete_discriminating_instance_and_symbolically
Evidence notes

A concrete instantiation alone can hide a defect a symbolic build exposes (and vice versa), so both are checked. The concrete leg checks all three of (5,3)'s differing bits rather than one, since a single bit position could not discriminate a combine with the operands or the two bit-arguments transposed.

footprint-Nat.testBit_xor

Kind
instance-pin
Status
checked

Supports: axiom_footprint: [] -- the Nat environment admits no trusted declaration

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

Reports `nat: axiom=0 opaque=0 quotient=0 total_trusted=0`, over the FULL trusted surface rather than `Declaration::Axiom` alone. The enumeration is per-environment, not per-theorem; it bounds this theorem's footprint because a proof cannot depend on a trusted declaration the environment does not contain.

Provenance

{
  "date": "2026-08-29",
  "established_by": "axeyum-lean-kernel build_nat_prelude, lane nat-testbit-xor",
  "source": "theorem name and canonical type read directly via nat_theorem_inventory, which prints render_lean of the admitted type."
}