kernel-Int.mod_eq_cancel_left_div_gcd
- Kind
- kernel-term
- Status
- checked
Supports: ∀ {m a b c : ℤ}, 0 < m → c * a ≡ c * b [ZMOD m] → a ≡ b [ZMOD m / ↑(m.gcd c)]
test "$(cargo run -q -p axeyum-lean-kernel --example int_theorem_inventory -- mod_eq_cancel_left_div_gcd 2>/dev/null | /usr/bin/grep -cE '^theorem[[:space:]]+Int\.mod_eq_cancel_left_div_gcd[[:space:]]')" -ge 1 Evidence notes
build_int_prelude admits Int.mod_eq_cancel_left_div_gcd through the trusted Kernel::add_declaration gate. New proof, lane modeq-div-gcd, in int_prelude/modeq_cancel_div_gcd.rs. int-dvd-mirrors (docs/plan/status/335-int-dvd-mirrors.md) left this open, sized as needing new machinery built from Int.gcd_div_gcd_div_gcd -- that lemma already existed (gcd.rs) by the time this lane started; the actual missing piece was a way to cancel a shared nonzero factor from an Int.dvd statement, which this development had never built at the Int level (every prior use of mul_left_cancel_of_pos routed through the Nat version on natAbs quantities instead, e.g. Int.gcd_div_gcd_div_gcd's own proof). Route: with g := ofNat (gcd m c), qm := m.ediv g, qc := c.ediv g -- g's Nat-side positivity comes from natAbs m > 0 (from 0 < m) fed directly into Nat.gcd_dvd_left/Nat.one_le_of_dvd_pos on natAbs m/natAbs c (Int.gcd unfolds to exactly that Nat.gcd application by definition, no bridge lemma needed); m = g*qm and c = g*qc exactly (mirroring gcd.rs's private exact closure inside declare_gcd_div_gcd_div_gcd); gcd qm qc = 1 directly from Int.gcd_div_gcd_div_gcd(m,c,pos); the hypothesis ModEq m (c*a) (c*b) bridges to dvd m (c*(b-a)) via modeq_to_dvd + Int.mul_sub (both already unconditional), rewrites through m=g*qm, c=g*qc to dvd (g*qm) (g*(qc*(b-a))), and a new existential-unpacking scale-cancellation lemma (imul_left_cancel_of_ne, built from Int.mul_eq_zero -- ZZ has no zero divisors -- plus basic add/neg/sub algebra) cancels the shared g; Int.gauss_lemma (coprime qm qc, qm | qc*(b-a)) gives qm | (b-a), and dvd_to_modeq closes it as ModEq qm a b. int_theorem_inventory's rendered type matches this fact's formal.statement exactly (mod the same carrier-name rewriting as every other Int mirror: Int.ediv/Int.ofNat/Int.gcd for / .gcd/coercion). int_theorem_inventory exits non-zero (0 rows) for a bogus name (measured). No substring collision against the sibling Int.mod_eq_cancel_right_div_gcd under the anchored pattern (both queried and grepped independently).