The areas / V12. Number theory
Mathlib.NumberTheory.FrobeniusNumber
20 declarations and 1 deprecated aliases. Mathlib docs · Source
def FrobeniusNumber E1 #
ℕ → Set ℕ → Prop
A natural number n is the Frobenius number of a set of natural numbers s if it is an
upper bound on the complement of the additive submonoid generated by s.
In other words, it is the largest number that cannot be expressed as a sum of numbers in s.
theorem frobeniusNumber_iff E0 #
∀ {n : ℕ} {s : Set ℕ}, FrobeniusNumber n s ↔ n ∉ AddSubmonoid.closure s ∧ ∀ k > n, k ∈ AddSubmonoid.closure s
theorem frobeniusNumber_pair E1 #
∀ {m n : ℕ}, m.Coprime n → 1 < m → 1 < n → FrobeniusNumber (m * n - m - n) {m, n}
The Chicken McNugget theorem stating that the Frobenius number
of positive numbers m and n is m * n - m - n.
def Nat.setGcd E1 #
Set ℕ → ℕ
The gcd of a set of natural numbers is defined to be the nonnegative generator
of the ideal of ℤ generated by them.
theorem Nat.setGcd_dvd_of_mem E1 #
∀ {s : Set ℕ} {n : ℕ}, n ∈ s → Nat.setGcd s ∣ n
theorem Nat.setGcd_dvd_of_mem_closure E1 #
∀ {s : Set ℕ} {n : ℕ}, n ∈ AddSubmonoid.closure s → Nat.setGcd s ∣ n
theorem Nat.dvd_setGcd_iff E0 #
∀ {s : Set ℕ} {n : ℕ}, n ∣ Nat.setGcd s ↔ ∀ m ∈ s, n ∣ m
The characterizing property of Nat.setGcd.
theorem Nat.setGcd_mono E1 #
∀ {s t : Set ℕ}, s ⊆ t → Nat.setGcd t ∣ Nat.setGcd s
theorem Nat.dvdNotUnit_setGcd_insert E1 #
∀ {s : Set ℕ} {n : ℕ}, ¬Nat.setGcd s ∣ n → DvdNotUnit (Nat.setGcd (insert n s)) (Nat.setGcd s)
theorem Nat.setGcd_insert_of_dvd E1 #
∀ {s : Set ℕ} {n : ℕ}, Nat.setGcd s ∣ n → Nat.setGcd (insert n s) = Nat.setGcd s
theorem Nat.setGcd_eq_zero_iff E0 #
∀ {s : Set ℕ}, Nat.setGcd s = 0 ↔ s ⊆ {0}
theorem Nat.exists_ne_zero_of_setGcd_ne_zero E1 #
∀ {s : Set ℕ}, Nat.setGcd s ≠ 0 → ∃ n ∈ s, n ≠ 0
theorem Nat.span_singleton_setGcd E1 #
∀ (s : Set ℕ), Ideal.span {↑(Nat.setGcd s)} = Ideal.span (Nat.cast '' s)
theorem Nat.subset_span_setGcd E1 #
∀ (s : Set ℕ), s ⊆ ↑(Ideal.span {Nat.setGcd s})
theorem Nat.exists_mem_span_nat_finset_of_ge E1 #
∀ (s : Set ℕ), ∃ t n, ↑t ⊆ s ∧ ∀ m ≥ n, Nat.setGcd s ∣ m → m ∈ Ideal.span ↑t
theorem Nat.exists_mem_closure_of_ge E1 #
∀ (s : Set ℕ), ∃ n, ∀ m ≥ n, Nat.setGcd s ∣ m → m ∈ AddSubmonoid.closure s
theorem Nat.finite_setOfPred_setGcd_dvd_and_mem_span E1 #
∀ (s : Set ℕ), {n | Nat.setGcd s ∣ n ∧ n ∉ Ideal.span s}.Finite
instance Nat.instIsNoetherian E0 #
IsNoetherian ℕ ℕ
ℕ is a Noetherian ℕ-module, i.e., ℕ is a Noetherian semiring.
theorem Nat.addSubmonoid_fg E1 #
∀ (s : AddSubmonoid ℕ), s.FG
theorem exists_frobeniusNumber_iff E0 #
∀ {s : Set ℕ}, (∃ n, FrobeniusNumber n s) ↔ Nat.setGcd s = 1 ∧ 1 ∉ s
A set of natural numbers has a Frobenius number iff their gcd is 1; if 1 is in the set, the Frobenius number is -1, so the Frobenius number doesn't exist as a natural number. Wikipedia seems to attribute this to Issai Schur, but Schur's theorem is a more precise statement about asymptotics of the number of ℕ-linear combinations, and the existence of the Frobenius number for a set with gcd 1 is probably well known before that.
Deprecated aliases
| Name | New name | Since |
|---|---|---|
Nat.finite_setOf_setGcd_dvd_and_mem_span | Nat.finite_setOfPred_setGcd_dvd_and_mem_span | 2026-07-09 |