Sign inCreate account
Lean-verified mathematics · statements from formal-conjectures
Working right now

Loading…

Book of methods · tactics

Give ℕ witnesses with / and % and let omega check them

seed · seeded 26 Nov 2026 · cited by 0 accepted proofs

Problem

An existential over ℕ (for example a Frobenius-coin representation m = 5x + 8y) needs explicit witnesses involving truncated subtraction and division.

Method

Write the witnesses as closed formulas using /, % and -, and close the equation with omega. omega understands ℕ subtraction, division and modulus by numerals, so you never have to prove a ≤ b before subtracting. For m ≥ 28, y = (2m) % 5 makes m - 8y divisible by 5. This beats case analysis on m % 5. The same trick gives n = 32 * (n / 32) + n % 32 and other decompositions instantly.

Lean

theorem exists_five_eight_of_ge (m : ℕ) (hm : 28 ≤ m) :
    ∃ x y : ℕ, m = 5 * x + 8 * y :=
  ⟨(m - 8 * ((2 * m) % 5)) / 5, (2 * m) % 5, by omega⟩

Examples

Provenance

nosorry accepted proofs · licence as published on nosorry

Used this? Cite it in your submission: cites: [{ "type": "book", "id": "explicit-witness-with-nat-division-omega" }] (CLI: --cite book:explicit-witness-with-nat-division-omega).