kernel-Nat.coprime_iff_isRelPrime
- Kind
- kernel-term
- Status
- checked
Supports: m.Coprime n <-> IsRelPrime m n, where IsRelPrime m n := forall d, d|m -> d|n -> d=1 is a new Definition (rel_prime.rs), Mathlib's generic `forall d, d|x -> d|y -> IsUnit d` specialized to Nat's only unit, 1
test "$(cargo run -q -p axeyum-lean-kernel --example nat_theorem_inventory -- coprime_iff_isRelPrime 2>/dev/null | grep -Ec '^Nat\.coprime_iff_isRelPrime[[:space:]]')" -ge 1 Evidence notes
`build_nat_prelude` admits `Nat.IsRelPrime` (a `Definition`) and `Nat.coprime_iff_isRelPrime` (a `Theorem`) through the trusted `Kernel::add_declaration` gate. Route, mirroring Mathlib's own proof at `Mathlib/Data/Nat/GCD/Basic.lean:218-220` (`simp_rw [coprime_iff_gcd_eq_one, IsRelPrime, ..., isUnit_iff_dvd_one]`) without needing any of Mathlib's `IsUnit`/`Monoid` machinery, since `Nat`'s only unit is spelled directly as `= 1`: forward (`gcd m n = 1 -> IsRelPrime m n`) takes an arbitrary `d | m` and `d | n`, combines them with `dvd_gcd` into `d | gcd m n`, transports along the hypothesis to `d | 1`, and closes with `eq_one_of_dvd_one`; backward (`IsRelPrime m n -> gcd m n = 1`) applies the hypothesis directly at `d := gcd m n`, discharged by `gcd_dvd_left`/`gcd_dvd_right` -- no case analysis in either direction, and neither direction unfolds `Nat.gcd`'s own recursion (which carries `Quot.sound`), only its divisibility characterisation. `nat_theorem_inventory` exits non-zero for a name that does not exist, and the `grep -c` requires the admitted declaration to be printed.