kernel-Int.mod_eq_add_left_cancel_general
- Kind
- kernel-term
- Status
- checked
Supports: ∀ {n a b c d : ℤ}, a ≡ b [ZMOD n] → a + c ≡ b + d [ZMOD n] → c ≡ d [ZMOD n]
test "$(cargo run -q -p axeyum-lean-kernel --example int_theorem_inventory -- mod_eq_add_left_cancel_general 2>/dev/null | /usr/bin/grep -cE '^theorem[[:space:]]+Int\.mod_eq_add_left_cancel_general[[:space:]]')" -ge 1 Evidence notes
`build_int_prelude` admits `Int.mod_eq_add_left_cancel_general` 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. New proof, lane int-dvd-mirrors: `int_prelude/dvd_gcd_mirrors.rs`'s `declare_mod_eq_add_left_cancel_general` -- Mathlib's 4-variable `Int.ModEq.add_left_cancel` (distinct from the existing 3-variable `p.mod_eq_add_left_cancel`, which cancels a SHARED addend on both sides, `ModEq n (c+a) (c+b) → ModEq n a b`). Scale `a≡b` on the right by `c` (`ModEq n (a+c) (b+c)`), flip it, chain against the second hypothesis (`ModEq n (a+c)(b+e)`) to get `ModEq n (b+c)(b+e)`, then cancel `b` on the left with the existing `mod_eq_add_left_cancel`. `int_theorem_inventory`'s rendered type matches this fact's `formal.statement` (`∀ {n a b c d : ℤ}, a ≡ b [ZMOD n] → a + c ≡ b + d [ZMOD n] → c ≡ d [ZMOD n]`). `int_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; the anchor requires the exact name followed by whitespace, so it cannot match a longer sibling name sharing the same prefix. Verified both ways: the real name greps to a count `-ge 1`; grepping a fabricated name (`Int.mod_eq_add_left_cancel_general_bogus_xyz`) makes `int_theorem_inventory` fail closed (exit 1, "no Int declaration matches").