lean_workbook_plus_38077
ProvedLet the number of pennies be , the number of nickels be , and the number of dimes be . Now, we have two equations: and . Subtracting the first from the second we obtain: Now, must be an integer, so we have is divisible by , thus we must have that is divisible by , which gives . Surely, we can only have either or . Testing, both values of give solutions:
Preamble
import Mathlib.Analysis.Complex.Basic
Formal statement
theorem lean_workbook_plus_38077 (p n d : ℕ) (h₀ : p + n + d = 21) (h₁ : p + 5 * n + 10 * d = 100) (h₂ : 0 < p ∧ 0 < n ∧ 0 < d) : (p, n, d) = (10, 4, 7) ∨ (p, n, d) = (5, 13, 3) := by sorry
Source