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

Recorded description

For every natural m, n, i: testBit(lor(m, n), i) = max(testBit(m, i), testBit(n, i)), where max is computed as bool_select_nat(ble(x, y), y, x).

Formal statement
theorem Nat.testBit_lor : ((x0 : AxNat) -> ((x1 : AxNat) -> ((x2 : AxNat) -> Eq.{1} AxNat (AxNat.testBit (AxNat.lor x0 x1) x2) (Bool.rec.{1} (fun (x3 : Bool) => AxNat) (AxNat.testBit x0 x2) (AxNat.testBit x1 x2) (AxNat.ble (AxNat.testBit x0 x2) (AxNat.testBit x1 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. lor(0, n) = n lor(m, 0) = m a bit of xor m n is the per-bit each bit of a bitwise AND is th Mathlib v4.30 source propositio Mathlib v4.30 source propositio Mathlib v4.30 source propositio Mathlib v4.30 source propositio Current fact Mathlib v4.30 source propositio Mathlib v4.30 source propositio
21 direct dependencies 2 direct dependents Graph shows the first 8 on each side.

Evidence

kernel-Nat.testBit_lor

Kind
kernel-term
Status
checked

Supports: Nat.testBit_lor 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 -- testBit_lor 2>/dev/null | grep -Ec '^Nat\.testBit_lor[[: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 (expected >= 1) decides the exit status, never `grep -q` under pipefail. Anchored with `[[:space:]]`, never a literal tab. `--release` is mandatory: this tool builds `creal`/`complex`/`cpoint`, which overflow the default debug thread stack.

concrete-Nat.testBit_lor

Kind
kernel-term
Status
checked

Supports: Checked at the concrete instance (m, n) = (3, 5) (binary 011/101, lor 3 5 = 7 = 111, matching the pre-existing lor_three_five sanity check's numeral pair) across all three bits, each with a negative control that the OTHER bit value does not also def-eq -- and symbolically against a genuinely free (m, n, i) triple.

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

The same numeral pair as F:nat-testbit-land's (3,5) is reused deliberately (matching this file's own `land_three_five`/`lor_three_five` convention), so a copy-paste between the two facts' proofs would fail loudly rather than passing -- the per-bit values genuinely differ (AND: 1,0,0; OR: 1,1,1 at this pair).

footprint-Nat.testBit_lor

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-30",
  "established_by": "axeyum-lean-kernel build_nat_prelude, lane blocked-mirror-divergences",
  "source": "theorem name and canonical type read directly via nat_theorem_inventory, which prints render_lean of the admitted type."
}