Identifier
F:nat-bitwise-comm
Proof route
kernel-lean
External status
proved
Axiom footprint
Empty

Recorded description

For every Bool -> Bool -> Bool function f such that f is commutative, and every natural m, n: bitwise(f, m, n) = bitwise(f, n, m).

Formal statement
theorem Nat.bitwise_comm : ((x0 : ((x0 : Bool) -> ((x1 : Bool) -> Bool))) -> ((x1 : ((x1 : Bool) -> ((x2 : Bool) -> Eq.{1} Bool (x0 x1 x2) (x0 x2 x1)))) -> ((x2 : AxNat) -> ((x3 : AxNat) -> Eq.{1} AxNat (AxNat.bitwise x0 x2 x3) (AxNat.bitwise x0 x3 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 com n is <= n plus anything Mathlib v4.30 source propositio Current fact
3 direct dependencies 0 direct dependents

Evidence

kernel-Nat.bitwise_comm

Kind
kernel-term
Status
checked

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

Checker command
test "$(cargo run -q --release -p axeyum-lean-kernel --example nat_theorem_inventory -- bitwise_comm 2>/dev/null | grep -Ec '^Nat\.bitwise_comm[[:space:]]')" -ge 1
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 decides the exit status. Anchored with `^Nat\.bitwise_comm[[:space:]]` so a sibling name cannot satisfy this row. Run `--release` -- the debug build of this inventory example SIGABRTs on stack depth (unrelated to this proof).

compute-Nat.bitwise_comm

Kind
kernel-term
Status
checked

Supports: bitwise(xor, 3, 5) = bitwise(xor, 5, 3) = 6 (0b011 xor 0b101 = 0b110), a DISCRIMINATING instance -- a symmetric pair like (5, 5) cannot catch a transposed argument.

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

Applies `Nat.bitwise_comm` symbolically (against free `m`, `n` at a fixed concrete `f = xor_fn`) and at the concrete, bit-differing instance `(m, n) = (3, 5)`, confirming both that the admitted type matches `Eq (bitwise xor 3 5) (bitwise xor 5 3)` and that both sides compute to `6`. The `hf` commutativity witness for `xor_fn` is itself built and kernel-checked in the same test (`bool_fn_comm`, a four-leaf `Bool.rec` case split). A companion negative control shows `bitwise_aux_comm_of_fuel`'s UNCONDITIONAL analogue is false for `f = or_fn` at insufficient fuel (`bitwiseAux or 0 0 1 = 1` against `bitwiseAux or 0 1 0 = 0`), confirmed by a Python simulation before any Rust was written (`docs/plan/status/256-nat-bitwise-comm.md`).

footprint-Nat.bitwise_comm

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-bitwise-comm",
  "source": "theorem name and canonical type read directly via nat_theorem_inventory, which prints render_lean of the admitted type."
}