kernel-Nat.coprime_eq_of_mul_eq_zero
- Kind
- kernel-term
- Status
- checked
Supports: ∀ {m n : ℕ}, m.Coprime n → m * n = 0 → m = 0 ∧ n = 1 ∨ m = 1 ∧ n = 0
test "$(cargo run -q --release -p axeyum-lean-kernel --example nat_theorem_inventory -- coprime_eq_of_mul_eq_zero 2>/dev/null | grep -Ec '^Nat\.coprime_eq_of_mul_eq_zero[[:space:]]')" -ge 1 Evidence notes
`Nat.coprime_eq_of_mul_eq_zero` (nat_prelude/draw11_mirrors.rs, `declare_coprime_eq_of_mul_eq_zero`, lane draw11-theorems-b) is a fresh construction: `Nat.mul_eq_zero` splits `m*n=0` into `m=0 ∨ n=0`; each disjunct is substituted into the coprimality hypothesis and collapsed with `Nat.gcd_zero_left` (the `n=0` case additionally uses `Nat.gcd_comm`, since the zero then sits on the wrong side for `gcd_zero_left` directly) to force the OTHER variable to `1`, then packaged with `And.intro`/`Or.inl`/`Or.inr`. `nat_theorem_inventory`'s rendered type is `((x0 : AxNat) -> ((x1 : AxNat) -> ((x2 : Eq.{1} AxNat (AxNat.gcd x0 x1) (AxNat.succ AxNat.zero)) -> ((x3 : Eq.{1} AxNat (AxNat.mul x0 x1) AxNat.zero) -> Or (And (Eq.{1} AxNat x0 AxNat.zero) (Eq.{1} AxNat x1 (AxNat.succ AxNat.zero))) (And (Eq.{1} AxNat x0 (AxNat.succ AxNat.zero)) (Eq.{1} AxNat x1 AxNat.zero))))))`, matching `formal.statement` verbatim. `nat_theorem_inventory` exits non-zero for a name that does not exist, and the `grep -c` count (tested `-ge 1`, not piped into `grep -q`) requires the admitted declaration to actually be printed. A discriminating unit test in `nat_prelude_tests.rs` (`coprime_eq_of_mul_eq_zero_selects_the_correct_disjunct`) applies the theorem to real witnesses at `(m,n)=(0,1)` (both hypotheses `rfl`) all the way to a proof term inferred against the LEFT disjunct, and checks the type shape at `(m,n)=(1,0)` selects the RIGHT disjunct -- discriminating a swapped `Or.inl`/`Or.inr`.