kernel-Nat.euclid_lemma
- Kind
- kernel-term
- Status
- checked
Supports: If p is prime and p divides a*b, then p divides a or p divides b.
test "$(cargo run -q -p axeyum-lean-kernel --example nat_theorem_inventory -- euclid_lemma 2>/dev/null | grep -xFc 'Nat.euclid_lemma 7 ((x0 : AxNat) -> ((x1 : AxNat) -> ((x2 : AxNat) -> ((x3 : And (AxNat.le (AxNat.succ (AxNat.succ AxNat.zero)) x0) (((x3 : AxNat) -> ((x4 : AxNat.dvd x3 x0) -> Or (Eq.{1} AxNat x3 (AxNat.succ AxNat.zero)) (Eq.{1} AxNat x3 x0))))) -> ((x4 : AxNat.dvd x0 (AxNat.mul x1 x2)) -> Or (AxNat.dvd x0 x1) (AxNat.dvd x0 x2))))))')" -ge 1 Evidence notes
`build_nat_prelude` admits this through the trusted `Kernel::add_declaration` gate, which re-checks the proof term against the stated type, so producing the row is a machine-checked proof. Primality is spelled inline as `2 <= p AND forall d, d | p -> d = 1 OR d = p`, matching this fact's `formal.statement` rather than a `Prime` abbreviation -- a fact is only closed by the statement it actually makes. Proof: let g = gcd p a; g | p, so primality splits g = 1 or g = p. If g = p then p = gcd p a | a. If g = 1, Bezout gives naturals with (1 + p*mn) + a*nn = p*mp + a*np; scaling by b puts it in the form b + X = Y with p | X and p | Y (using p | a*b on the a-terms), and `dvd_add_right_cancel_of_pos` yields p | b WITHOUT forming a difference, which is what makes the argument valid over the naturals. The command names its own subject twice over: the example exits non-zero for a name that does not exist, and the grep requires the admitted declaration to be printed. TIGHTENED 2026-08-17: the command matched the NAME only, which a weakened statement survives. Lane `nat-prime-divisor` measured this concretely on its own theorem — spelling a primality bound `1 <= p` instead of `2 <= p` still type-checks, still admits, and passes every name-only checker, while being satisfied by p = 1. The kernel cannot see a weaker statement; only comparing the rendered TYPE can. This now matches the full type exactly (grep -qxF), so any change to the proposition breaks it.