kernel-Nat.exists_mul_mod_eq_gcd
- Kind
- kernel-term
- Status
- checked
Supports: The proposition declared as `Nat.exists_mul_mod_eq_gcd` in the pinned Mathlib v4.30 source.
cargo test -p axeyum-lean-kernel --lib int_prelude:: Evidence notes
`Nat.exists_mul_mod_eq_gcd` in `crates/axeyum-lean-kernel/src/int_prelude/gcd.rs` (`declare_exists_mul_mod_eq_gcd`). Genuine work, not a corollary of the Bezout-witness landing: the Bezout identity `ofNat (gcd n k) = ofNat n * gcdA n k + ofNat k * gcdB n k` gives an INTEGER coefficient `gcdA n k` (possibly negative, possibly out of range), not the bounded NATURAL witness the statement demands. The bridge is reducing `gcdA n k` modulo `k` (`Int.ModEq.mul_left` to replace the coefficient by its residue, `Int.mod_modEq`/`Int.ModEq.symm` to name that residue, `Int.modEq_add_mul_left` to discard the `ofNat k * gcdB n k` summand as an exact multiple of the modulus, and `emod_eq_self_of_in_range` -- already `pub(super)` in `wilson.rs` -- to identify `emod (ofNat (gcd n k)) (ofNat k)` with `ofNat (gcd n k)` under the `gcd n k < k` hypothesis) then descending the resulting `Int` equation `ofNat (gcd n k) = ofNat (n * m % k)` to the stated `Nat` equation by `natAbs`, which is the identity on `ofNat` by computation. No new axiom, no new public lemma outside `gcd.rs`; every intermediate lemma used (`Int.modEq_add_mul_left`, `Int.ModEq.mul_left`, `Int.mod_modEq`, `Int.ModEq.symm`, `Int.emod_nonneg`, `Int.emod_lt_of_pos`, `Int.of_nat_nat_abs_of_nonneg`) already existed.