Primality and GCD on pnat #
This file extends the theory of ℕ+ with gcd, lcm and Prime functions, analogous to those on
Nat.
The canonical map from Nat.Primes to ℕ+
Instances For
The greatest common divisor (gcd) of two positive natural numbers, viewed as positive natural number.
Instances For
The least common multiple (lcm) of two positive natural numbers, viewed as positive natural number.
Instances For
Prime numbers #
Primality predicate for ℕ+, defined in terms of Nat.Prime.
Instances For
Coprime numbers and gcd #
Two pnats are coprime if their gcd is 1.
Instances For
theorem
PNat.Coprime.factor_eq_gcd_left
{a b m n : ℕ+}
(cop : m.Coprime n)
(am : a ∣ m)
(bn : b ∣ n)
:
a = (a * b).gcd m
theorem
PNat.Coprime.factor_eq_gcd_right
{a b m n : ℕ+}
(cop : m.Coprime n)
(am : a ∣ m)
(bn : b ∣ n)
:
a = (b * a).gcd m
theorem
PNat.Coprime.factor_eq_gcd_left_right
{a b m n : ℕ+}
(cop : m.Coprime n)
(am : a ∣ m)
(bn : b ∣ n)
:
a = m.gcd (a * b)
theorem
PNat.Coprime.factor_eq_gcd_right_right
{a b m n : ℕ+}
(cop : m.Coprime n)
(am : a ∣ m)
(bn : b ∣ n)
:
a = m.gcd (b * a)
@[deprecated PNat.gcd_eq_left_iff_dvd (since := "2025-11-14")]
Alias of the reverse direction of PNat.gcd_eq_left_iff_dvd.