kernel-Nat.log_eq_one_iff-prime
- Kind
- kernel-term
- Status
- checked
Supports: ∀ {b n : ℕ}, Nat.log b n = 1 ↔ b ≤ n ∧ n < b * b
test "$(cargo run -q -p axeyum-lean-kernel --example nat_theorem_inventory -- "log_eq_one_iff'" 2>/dev/null | grep -Ec "^Nat\.log_eq_one_iff'[[:space:]]")" -ge 1 Evidence notes
`build_nat_prelude` admits `Nat.log_eq_one_iff'` through the trusted `Kernel::add_declaration` gate (declared in `nat_prelude/log_clog_mirrors.rs`'s `declare_log_eq_one_iff_prime`, lane `nat-mirror-residue`). `mpr` (`Le b n -> Lt n (mul b b) -> Eq (log b n) 1`) is `log_eq_one_of_bounds`: since `1 < b` is not given, it is derived from the bounds (`derive_one_lt_base_from_bounds`: if `b <= 1` then `b*b <= b <= 1` via `mul_le_mul_left`/`mul_one`/`le_trans`, so `n < 1`, so `n = 0` (`le_of_lt_succ`+`le_antisymm`+`zero_le`), so with `b <= n` also `b = 0`, contradicting `n < b*b = 0` via `not_lt_zero`), then the usual `cases_zero_succ` unfold (both guard cuts known true, two `bool_transport`s reduced->general, INNER `2<=b` first then OUTER `b<=n` -- `log`'s nesting) aimed at `Eq (_, 1)`, with the recursive `logAux ... = 0` from `div_lt_of_lt_mul` (forward direction, already in the prelude) plus a new fuel-agnostic `log_aux_lt_eq_zero` (`log_of_lt`'s step-case technique generalized off the diagonal fuel). `mp` (`Eq (log b n) 1 -> Le b n /\ Lt n (mul b b)`) composes `log_eq_one_derive_base_le_n` (`Nat.lt_or_ge n b`, the `n<b` side refuted the same way `log_eq_zero_iff`'s `mp` refutes its `1<b` sub-case) with `log_eq_one_derive_sq_bound` -- the genuinely new piece this file's module doc previously called missing (`log b n < 2 -> n < b*b`): peel `h` (general->specific, TWO `bool_transport`s using the FORWARD `ble_eq_true_of_le` evidence, OUTER `b<=n` first) down to `Eq (logAux b n' quotient) 0`, then `log_aux_eq_zero_imp_lt` (the CONVERSE of `log_aux_lt_eq_zero`, fuel-generalized via `cases_zero_succ` alone -- no induction -- fed `Le quotient n'` from `div_lt_self`+`le_of_lt_succ`) gives `Lt quotient b`, and `lt_mul_of_div_lt` (the BACKWARD direction of `Nat.div_mod_lt_mul_iff`, needing `Lt 0 b` unlike the forward direction already present) finishes. `nat_theorem_inventory`'s rendered type for `Nat.log_eq_one_iff'` is `(x0:AxNat)->(x1:AxNat)->Iff (Eq (log x0 x1) (succ zero)) (And (Le x0 x1) (Lt x1 (mul x0 x0)))`, matching this fact's `formal.statement` verbatim (`x0`=b, `x1`=n). `nat_theorem_inventory` exits non-zero for a name that does not exist (verified against `log_eq_one_iff_xxxx`: `error: no Nat theorem matches ...`, count 0), and the `grep -c` count (tested `-ge 1`, not piped into `grep -q`) requires the admitted declaration to actually be printed.