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

Recorded description

For every bit-combining function f and every natural m, the general bitwise combinator applied to (f, m, 0) equals m when f true false holds and 0 otherwise.

Formal statement
theorem Nat.bitwise_zero_right : ((x0 : ((x0 : Bool) -> ((x1 : Bool) -> Bool))) -> ((x1 : AxNat) -> Eq.{1} AxNat (AxNat.bitwise x0 x1 AxNat.zero) (Bool.rec.{1} (fun (x2 : Bool) => AxNat) AxNat.zero x1 (x0 Bool.true Bool.false))))

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. Current fact a bit of xor m n is the per-bit
0 direct dependencies 1 direct dependents

Evidence

kernel-Nat.bitwise_zero_right

Kind
kernel-term
Status
checked

Supports: forall f m, bitwise f m 0 = if f true false then m else 0

Checker command
test "$(cargo run -q -p axeyum-lean-kernel --example nat_theorem_inventory -- bitwise_zero_right 2>/dev/null | grep -Ec '^Nat\.bitwise_zero_right[[:space:]]')" -ge 1
Evidence notes

`build_nat_prelude` admits this theorem through the trusted `Kernel::add_declaration` gate, which re-checks the proof term against the stated type, so producing this row at all is a machine-checked proof. Universally quantified over `f : Bool -> Bool -> Bool` and `m : Nat`, holds unconditionally. Proved by induction on `m`: every step is `Eq.refl` (the `n = 0` guard, tested outermost with the theorem's own literal `0`, collapses the whole succ-step term regardless of the fuel predecessor -- exactly `land_zero_right`'s shape). The BASE case is the one piece of proof content beyond `land`/`lor`/`ldiff`'s zero-right theorems: at `m = 0` the LHS reduces to `bitwiseAux`'s fuel-exhaustion row conditioned on `f false true` while the RHS is conditioned on `f true false` -- two different, generally non-defeq `Bool` terms for symbolic `f` -- both provably `0` there via a small `Bool`-case-split lemma (`bool_select_same`, `bitwise.rs`) rather than by `refl` alone. `nat_theorem_inventory` exits non-zero for a name that does not exist, and `grep -Ec` consumes the pipe and the count is tested, so the exit status depends on what the run found. Anchored with `^Nat\.bitwise_zero_right[[:space:]]` (verified exactly 1 row).

compute-Nat.bitwise_zero_right

Kind
kernel-term
Status
checked

Supports: the theorem specializes correctly at both an absorbing and a non-absorbing f

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

Instantiates the universal theorem at two concrete `f` witnesses (`and_fn`, `or_fn`, built inline) and a concrete `m = 9`, confirming the ADMITTED TYPE at each instantiation `def_eq`s the expected specialization: at `and_fn` (absorbing) `bitwise and_fn 9 0` reduces to `0`, at `or_fn` (identity) it reduces to `9` -- with negative controls that each instantiation must NOT also state the other's value.

footprint-Nat.bitwise_zero_right

Kind
exhaustive-enumeration
Status
checked

Supports: axiom_footprint: [] -- the Nat prelude's trusted surface is empty

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

`nat_axiom_inventory --require-axiom-free nat` enumerates the built Nat environment and exits non-zero unless it admits no Axiom, Opaque or Quotient declaration, including the `bool_select_same` case-split helper this theorem's base case needs. Measured with `Nat.bitwise` landed: `nat: axiom=0 opaque=0 quotient=0 total_trusted=0`.

Provenance

{
  "date": "2026-08-28",
  "established_by": "axeyum-lean-kernel build_nat_prelude, lane nat-bitwise-general",
  "source": "one of two f-general boundary theorems `declare_bitwise_all` (`crates/axeyum-lean-kernel/src/nat_prelude/bitwise.rs`) admits alongside the `Nat.bitwise`/`Nat.bitwiseAux` definitions"
}