kernel-Nat.mod_eq_cancel_left_div_gcd
- Kind
- kernel-term
- Status
- checked
Supports: ∀ {m a b c : ℕ}, 0 < m → c * a ≡ c * b [MOD m] → a ≡ b [MOD m / m.gcd c]
test "$(cargo run -q -p axeyum-lean-kernel --example nat_theorem_inventory -- mod_eq_cancel_left_div_gcd 2>/dev/null | grep -Ec '^Nat\.mod_eq_cancel_left_div_gcd[[:space:]]')" -ge 1 Evidence notes
`build_nat_prelude` admits `Nat.mod_eq_cancel_left_div_gcd` through the trusted `Kernel::add_declaration` gate, which re-checks the proof term against the stated type. New proof, lane modeq-div-gcd, in `nat_prelude/modeq_cancel_div_gcd.rs`, wired in via `declare_modeq_cancel_div_gcd`. `Nat.gcd_mul_right` (landed for a sibling family within the hour before this lane started) turned out NOT to be what unlocks this family -- `Nat.gcd_cofactors_coprime` (`bezout.rs`, pre-existing) does: with `g := gcd(m,c)`, `Nat.div_mul_cancel_of_dvd` gives `g*(m/g)=m` and `g*(c/g)=c`, substituting those into `gcd c m = gcd m c = g` (`gcd_comm`) gives `gcd (g*(c/g)) (g*(m/g)) = g`, and `gcd_cofactors_coprime` turns that into `gcd (c/g) (m/g) = 1` directly. A local helper (`mod_eq_cancel_scale`) then cancels the shared factor `g` from both the modulus and both endpoints of the rewritten hypothesis (`left_distrib`/`mul_assoc`/`Nat.mul_left_cancel_of_pos`, peeling `ModEq`'s nested existential the same way `euler.rs`'s `cancel_common_right_addend` does, with the SAME witnesses surviving), and the pre-existing coprime `Nat.mod_eq_cancel` finishes. `nat_theorem_inventory`'s rendered type matches this fact's `formal.statement` exactly (mod carrier-name rewriting: `AxNat` for `ℕ`, `AxNat.modEq`/`[MOD]`, `AxNat.lt`/`<`, `AxNat.div`/`/`, `AxNat.gcd`/`.gcd`). `nat_theorem_inventory` exits non-zero (0 rows) for a bogus name (`mod_eq_cancel_left_div_gcd_bogus`, measured). Verified no substring overlap against the sibling fact `Nat.mod_eq_cancel_left_div_gcd_general` (this fact's third mirror, `F:ml430-nat-modeq-cancel-left-div-gcd-cfca1225`): the anchored pattern `^Nat\.mod_eq_cancel_left_div_gcd[[:space:]]` matches exactly 1 row (its own), not the `_general` variant, in the combined inventory of all three new theorems.