kernel-Nat.mod_eq_gcd_eq
- Kind
- kernel-term
- Status
- checked
Supports: ∀ m a b, Nat.modEq m a b -> Nat.gcd a m = Nat.gcd b m
test "$(cargo run -q -p axeyum-lean-kernel --example nat_theorem_inventory -- mod_eq_gcd_eq 2>/dev/null | grep -Ec '^Nat\.mod_eq_gcd_eq[[:space:]]')" -ge 1 Evidence notes
`build_nat_prelude` admits `Nat.mod_eq_gcd_eq` through the trusted `Kernel::add_declaration` gate, which re-checks the proof term against the stated type, so producing this row at all is a machine-checked proof. `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. Confirmed kernel type: `∀ m a b, modEq m a b -> gcd a m = gcd b m`, matching the formal statement with `a`/`b` in Mathlib's order. Proved directly via `declare_modeq_gcd_eq` (`nat_prelude/gcd.rs`): eliminate the balanced-witness `modEq m a b := ∃ u v, a+m*u=b+m*v` twice; `gcd a m` divides `a` and `m` (`gcd_dvd_left`/`gcd_dvd_right`), hence `m*u` (`dvd_mul_right_of_dvd`) and so `a+m*u` (`dvd_add`); transport along the witness equation to `b+m*v`; reorder to `m*v+b` (`add_comm`) and peel `m*v` (`dvd_add_iff_right`, reversed) to land on `gcd a m ∣ b`; close with `dvd_gcd`. The mirror argument over the symmetric equation gives `gcd b m ∣ gcd a m`; `dvd_antisymm` finishes. No `Nat.ModEq` remainder-characterization route (`mod_eq_dvd_iff`/`div_mod`) was needed -- the balanced-witness definition sufficed directly.