Theorems · Theorem · number theory
Nat.exists_add_mul_eq_of_gcd_dvd_of_mul_pred_le
∀ (p q n : ℕ), p.gcd q ∣ n → p.pred * q.pred ≤ n → ∃ a b, a * p + b * q = n
If the gcd of two natural numbers p and q divides a third natural number n,
and if n is at least (p - 1) * (q - 1), then n can be represented as an ℕ-linear
combination of p and q.
TODO: show that if p.gcd q = 1 and 0 ≤ n ≤ (p - 1) * (q - 1) - 1 = N, then n is
representable iff N - n is not. In particular N is not representable, solving the
coin problem for two coins: https://en.wikipedia.org/wiki/Coin_problem#n_=_2.
- Defined in
- Mathlib.Algebra.Order.Ring.Int
- Cited by
- 3 results in Mathlib
- Foundations
- Depth 66 from the axioms · uses propext, Classical.choice, Quot.sound
Around this declaration
Dashed lines are statement dependencies; solid lines are citations in proofs.
Cites19
Mathlib declarations this one mentions in its statement or cites explicitly in its proof. Plumbing is filtered out.
- add_zeroproof · cited by 2,707
- zero_addproof · cited by 2,366
- mul_commproof · cited by 2,262
- MulZeroClass.mul_zeroproof · cited by 2,091
- add_assocproof · cited by 746
- add_le_addproof · cited by 666
- Nat.cast_addproof · cited by 586
- mul_addproof · cited by 413
- add_mulproof · cited by 363
- Nat.cast_mulproof · cited by 309
- mul_le_mul_of_nonneg_rightproof · cited by 301
- lt_irreflproof · cited by 190
Cited by3
Results whose statement or proof uses this declaration.
- Nat.maximalIdeal_eq_span_two_threeproof · cited by 1
- Ideal.isPrime_nat_iffproof · cited by 1
- frobeniusNumber_pairproof · cited by 0