kernel-Nat.stirlingFirst_succ_succ
- Kind
- kernel-term
- Status
- checked
Supports: ((x0 : AxNat) -> ((x1 : AxNat) -> Eq.{1} AxNat (AxNat.stirlingFirst (AxNat.succ x0) (AxNat.succ x1)) (AxNat.add (AxNat.mul x0 (AxNat.stirlingFirst x0 (AxNat.succ x1))) (AxNat.stirlingFirst x0 x1))))
test "$(cargo run -q --release -p axeyum-lean-kernel --example nat_theorem_inventory -- stirlingFirst_succ_succ 2>/dev/null | grep -Ec '^Nat\.stirlingFirst_succ_succ[[:space:]]')" -ge 1 Evidence notes
`build_nat_prelude` admits `Nat.stirlingFirst_succ_succ` through the trusted `Kernel::add_declaration` gate, declared in `nat_prelude/stirling_lemmas.rs`. `nat_theorem_inventory`'s rendered type is `((x0 : AxNat) -> ((x1 : AxNat) -> Eq.{1} AxNat (AxNat.stirlingFirst (AxNat.succ x0) (AxNat.succ x1)) (AxNat.add (AxNat.mul x0 (AxNat.stirlingFirst x0 (AxNat.succ x1))) (AxNat.stirlingFirst x0 x1))))`, matching this fact's `formal.statement` modulo binder info. The flip is honest under the def-vs-theorem criterion, checked at Mathlib's own source at the pinned commit `c5ea00351c28e24afc9f0f84379aa41082b1188f` (`Mathlib/Combinatorics/Enumerative/Stirling.lean:51` and `:113`) rather than from a paraphrase. Mathlib's `def stirlingFirst` / `def stirlingSecond` are `| 0, 0 => 1 | 0, _+1 => 0 | _+1, 0 => 0 | n+1, k+1 => c * f n (k+1) + f n k` with `c := n` for the first kind and `c := k+1` for the second -- which is `nat_prelude/stirling.rs`'s body verbatim, an outer recursion on the row index yielding a whole row and an inner one selecting the column, the shape Lean's equation compiler produces for those four cases. The strongest evidence that the two are the SAME function rather than merely extensionally equal is that Mathlib proves its own `stirlingFirst_zero`, `stirlingFirst_zero_succ`, `stirlingFirst_succ_zero` and `stirlingFirst_succ_succ` by **`rfl`**: the four defining equations are definitional on Mathlib's side exactly as they are on ours. This is the opposite of `Nat.multichoose`, where our body is Mathlib's THEOREM about a structurally different `def` and the mirrors must stay open. Construction: `Eq.refl` at the right-hand side: both recursor scrutinees are `succ` constructors, so the recurrence holds by delta-beta-iota and needs no equation lemma. Mathlib proves this one by `rfl` as well. `Nat.mul`'s operand order is Mathlib's (`n * f n (k+1)`), which puts the recursive call on the side `Nat.mul` recurses on, so the arithmetic stays stuck at symbolic arguments rather than partially evaluating. The tool exits non-zero for a name that does not exist, and the `grep -c` count (tested `-ge 1`, consuming the pipe, never `grep -q`) requires the admitted declaration to be printed. Verified both ways, and the negative control is a REAL Mathlib theorem rather than an invented name: this command exits 0 for all ten declared mirrors and exits 1 for `stirlingSecond_self`, which Mathlib proves and this prelude does not declare. Note that `nat_theorem_inventory` matches by PREFIX, so `stirlingFirst_zero` also prints `stirlingFirst_zero_succ`; the grep is anchored `^Nat.<name>[[:space:]]` for exactly that reason. Note also that it keeps only its LAST name argument, so this command passes exactly one, and `[[:space:]]` is used rather than `\t` because GNU grep reads `\t` in ERE as a literal `t`.