Documentation

Mathlib.Algebra.Order.Ring.Int

The integers form a linear ordered ring #

This file contains:

Recursors #

Miscellaneous lemmas #

theorem Nat.cast_natAbs {α : Type u_1} [AddGroupWithOne α] (n : ) :
n.natAbs = |n|
theorem Int.two_le_iff_pos_of_even {m : } (even : Even m) :
2 m 0 < m
theorem Int.add_two_le_iff_lt_of_even_sub {m n : } (even : Even (n - m)) :
m + 2 n m < n
theorem Nat.exists_add_mul_eq_of_gcd_dvd_of_mul_pred_le (p q n : ) (dvd : p.gcd q n) (le : 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.